Skip to content

Commit 81035fc

Browse files
committed
Backup
1 parent e652474 commit 81035fc

45 files changed

Lines changed: 2262 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

April_Fools_CSS/163341.user.js

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// ==UserScript==
2+
// @name April Fools CSS
3+
// @description Some CSS april fools
4+
// @author jerone
5+
// @namespace https://github.com/jerone/AprilFoolsCSS
6+
// @include *
7+
// @version 1.1
8+
// ==/UserScript==
9+
10+
if(window.top===window){
11+
12+
var duration = 2000, // [Integer, positive, miliseconds] This controls the duration of an april fool item;
13+
interval = 8000; // [Integer, positive, miliseconds] This controls the interval of the next april fool;
14+
15+
var aprilFools = [ // [String] April fools in CSS; Use {duration} for a dynamic duration;
16+
"img { \
17+
-webkit-transform: rotate(180deg); \
18+
-moz-transform: rotate(180deg); \
19+
-ms-transform: rotate(180deg); \
20+
-o-transform: rotate(180deg); \
21+
transform: rotate(180deg); \
22+
}",
23+
"body { \
24+
-webkit-transform: rotate(1deg); \
25+
-moz-transform: rotate(1deg); \
26+
-ms-transform: rotate(1deg); \
27+
-o-transform: rotate(1deg); \
28+
transform: rotate(1deg); \
29+
}",
30+
"body { \
31+
-webkit-perspective: 300px; \
32+
-moz-perspective: 300px; \
33+
-ms-perspective: 300px; \
34+
perspective: 300px; \
35+
-webkit-transform: rotateY(180deg); \
36+
-moz-transform: rotateY(180deg); \
37+
-ms-transform: rotateY(180deg); \
38+
transform: rotateY(180deg); \
39+
-webkit-transform-style: preserve-3d; \
40+
-moz-transform-style: preserve-3d; \
41+
-ms-transform-style: preserve-3d; \
42+
transform-style: preserve-3d; \
43+
}",
44+
"img { \
45+
-webkit-transform: scale(0.8); \
46+
-moz-transform: scale(0.8); \
47+
-ms-transform: scale(0.8); \
48+
-o-transform: scale(0.8); \
49+
transform: scale(0.8); \
50+
}",
51+
"img { -webkit-animation: spin {duration}s linear infinite; } \
52+
@-webkit-keyframes spin { \
53+
0% { -webkit-transform: rotate(0deg); } \
54+
100% { -webkit-transform: rotate(360deg); } \
55+
}",
56+
"body { -webkit-animation: rainbow {duration}s infinite; } \
57+
@-webkit-keyframes rainbow { \
58+
100% { -webkit-filter: hue-rotate(360deg); } \
59+
}",
60+
],
61+
aprilFool = 0, aprilFooled = 0;
62+
63+
interval = Math.abs(interval);
64+
duration = Math.max(1000, Math.abs(duration));
65+
66+
window.setInterval(function(){
67+
do { aprilFool = Math.floor(Math.random() * aprilFools.length);
68+
} while(aprilFool === aprilFooled);
69+
document.documentElement.classList.add("aprilfool" + (aprilFooled = aprilFool));
70+
window.console&&console.log("added aprilfool" + aprilFool);
71+
window.setTimeout(function(){
72+
document.documentElement.classList.remove("aprilfool" + aprilFooled);
73+
window.console&&console.log("removed aprilfool" + aprilFool);
74+
}, duration);
75+
}, interval + duration + 10);
76+
77+
for(var aprilFool in aprilFools){
78+
GM_addStyle(".aprilfool" + aprilFool + " " + aprilFools[aprilFool].replace("{duration}", duration/1000));
79+
}
80+
}

April_Fools_CSS/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[April Fools CSS](http://userscripts.org/scripts/show/163341)

Dakar_Extender/208433.user.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// ==UserScript==
2+
// @name Dakar Extender
3+
// @description Highlight riders by certain country in standings lists.
4+
// @namespace http://userscripts.org/scripts/show/208433
5+
// @version 2
6+
// @grant none
7+
// @require http://code.jquery.com/jquery-2.0.3.min.js
8+
// @icon https://lh6.googleusercontent.com/-pKPBVGEVXk0/UsXXxo0S9JI/AAAAAAAACp0/0N_pV4AqDMY/s512-no/Icon_Dakar2+%25281%2529.png
9+
// @include *dakar.com/*
10+
// ==/UserScript==
11+
12+
(function(){
13+
14+
var countryCode = "NLD";
15+
16+
$(function(){
17+
$("tr:contains('\("+countryCode+"\)')").css("font-weight","bold");
18+
});
19+
20+
})();
21+
22+
23+
24+
// ==UserStats==
25+
// Chars (excl. spaces): 610
26+
// Chars (incl. spaces): 716
27+
// Words: 65
28+
// Lines: 29
29+
// ==/UserStats==
206 KB
Loading

Dakar_Extender/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Dakar Extender](http://userscripts.org/scripts/show/208433)

Dakar_Extender/jquery-2.0.3.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Github_Gist_Dabblet/165244.user.js

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
// ==UserScript==
2+
// @name Github Gist Dabblet
3+
// @namespace http://userscripts.org/scripts/show/165244
4+
// @description Github Gist Dabblet
5+
// @include *://gist.github.com/*
6+
// @version 3
7+
// ==/UserScript==
8+
9+
/*
10+
* The following urls should be converted to dabblet:
11+
*
12+
* - https://gist.github.com/jerone/3810309
13+
* ¯¯¯¯¯¯¯
14+
* - https://gist.github.com/jerone/3810309/revisions
15+
* ¯¯¯¯¯¯¯
16+
* - https://gist.github.com/jerone/3810309/forks
17+
* ¯¯¯¯¯¯¯
18+
* - https://gist.github.com/jerone/3810309/stars
19+
* ¯¯¯¯¯¯¯
20+
* - https://gist.github.com/jerone/3810309/f2815cc6796ea985f74b8f5f3c717e8de3b12d37
21+
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
22+
* - https://gist.github.com/3810309/f2815cc6796ea985f74b8f5f3c717e8de3b12d37
23+
* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
24+
*/
25+
26+
String.format = function (string) {
27+
var args = Array.prototype.slice.call(arguments, 1, arguments.length);
28+
return string.replace(/{(\d+)}/g, function (match, number) {
29+
return typeof args[number] != "undefined" ? args[number] : match;
30+
});
31+
};
32+
33+
function addMenuItem() {
34+
var link, linkLong, url, menu, li, user;
35+
36+
if (document.getElementById("Github_Gist_Share_Dabblet")) return; // already defined in Github Gist Share (http://userscripts.org/scripts/show/157850);
37+
38+
if ((link = document.querySelector("[name='link-field']")) && (menu = document.querySelector('ul.menu.gisttabs'))) { // check if we're on an actual gists;
39+
user = document.querySelector(".author.vcard").textContent.trim();
40+
if ((linkLong = document.querySelector(".site-container.js-site-container")) && linkLong.dataset.url) {
41+
var linkLongParts = linkLong.dataset.url.split("/");
42+
linkLongParts.shift();
43+
if (/^(?:revisions|forks|stars)$/gi.test(linkLongParts[linkLongParts.length - 1])) {
44+
linkLongParts.pop();
45+
}
46+
if (new RegExp(user,"gi").test(linkLongParts[0])) {
47+
linkLongParts.shift();
48+
}
49+
url = "/" + linkLongParts.join("/");
50+
} else {
51+
url = link.value.replace(new RegExp("https?:\/\/gist\.github\.com/" + user, "gi"), "");
52+
}
53+
54+
url = "http://dabblet.com/gist" + url;
55+
56+
menu.appendChild(li = document.createElement("li"));
57+
li.id = "Github_Gist_Dabblet";
58+
59+
var key = "Dabblet",
60+
dabbletA = document.createElement("a"),
61+
dabbletImg = document.createElement("img");
62+
li.appendChild(dabbletA);
63+
dabbletA.appendChild(dabbletImg);
64+
dabbletA.href = url;
65+
dabbletA.title = String.format("[{0}] {1}", key, dabbletA.href);
66+
dabbletA.style.display = "inline-block";
67+
dabbletA.target = "_blank";
68+
dabbletImg.src = "http://dabblet.com/favicon.ico";
69+
dabbletImg.alt = key;
70+
}
71+
}
72+
73+
// init;
74+
addMenuItem();
75+
76+
// on pjax;
77+
$(document).on("pjax:success", addMenuItem);
78+
79+
80+
81+
// ==UserStats==
82+
// Chars (excl. spaces): 2.422
83+
// Chars (incl. spaces): 2.915
84+
// Words: 250
85+
// Lines: 86
86+
// ==/UserStats==

Github_Gist_Dabblet/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Github Gist Dabblet](http://userscripts.org/scripts/show/165244)

Github_Gist_Share/157850.user.js

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
// ==UserScript==
2+
// @name Github Gist Share
3+
// @namespace http://userscripts.org/scripts/show/157850
4+
// @description Github Gist Share
5+
// @include *://gist.github.com/*
6+
// @version 4
7+
// ==/UserScript==
8+
9+
String.format = function (string) {
10+
var args = Array.prototype.slice.call(arguments, 1, arguments.length);
11+
return string.replace(/{(\d+)}/g, function (match, number) {
12+
return typeof args[number] != "undefined" ? args[number] : match;
13+
});
14+
};
15+
16+
var socials = {
17+
Twitter: {
18+
show: function(url, user, description, files, stars, forks, revisions){
19+
return true;
20+
},
21+
submit: function(url, user, description, files, stars, forks, revisions){
22+
var stats = [];
23+
if(files > 1){
24+
stats.push(files + " files");
25+
}
26+
if(stars == 1){
27+
stats.push(stars + " star");
28+
} else if(stars > 1){
29+
stats.push(stars + " stars");
30+
}
31+
if(forks == 1){
32+
stats.push(forks + " fork");
33+
} else if(forks > 1){
34+
stats.push(forks + " forks");
35+
}
36+
if(revisions > 1){
37+
stats.push(revisions + " revisions");
38+
}
39+
40+
var tweet = String.format("Check out {0} #gist {1} on @github{2} |",
41+
user == document.querySelector(".name").textContent.trim() ? "my" : user + "'s",
42+
description ? "\"" + description + "\"" : "",
43+
stats.length > 0 ? " | " + stats.join(", ") : "");
44+
45+
return "https://twitter.com/intent/tweet?original_referer=" + encodeURIComponent(url) +
46+
"&source=tweetbutton&url=" + encodeURIComponent(url) +
47+
"&text=" + encodeURIComponent(tweet);
48+
},
49+
icon: "https://si0.twimg.com/favicons/favicon.ico"
50+
},
51+
Dabblet: {
52+
show: function(url, user, description, files, stars, forks, revisions){
53+
// already defined in another UserScript: http://userscripts.org/users/31497/scripts
54+
return !document.getElementById("Github_Gist_Dabblet");
55+
},
56+
submit: function(url, user, description, files, stars, forks, revisions){
57+
var linkLong;
58+
if ((linkLong = document.querySelector(".site-container.js-site-container")) && linkLong.dataset.url) {
59+
var linkLongParts = linkLong.dataset.url.split("/");
60+
linkLongParts.shift();
61+
if (/^(?:revisions|forks|stars)$/gi.test(linkLongParts[linkLongParts.length - 1])) {
62+
linkLongParts.pop();
63+
}
64+
if (new RegExp(user,"gi").test(linkLongParts[0])) {
65+
linkLongParts.shift();
66+
}
67+
url = "/" + linkLongParts.join("/");
68+
} else {
69+
url = url.replace(new RegExp("https?:\/\/gist\.github\.com/" + user, "gi"), "");
70+
}
71+
return "http://dabblet.com/gist" + url;
72+
},
73+
icon: "http://dabblet.com/favicon.ico"
74+
},
75+
UserScript: {
76+
show: function(url, user, description, files, stars, forks, revisions){
77+
return !!document.querySelector(".bubble[id^='file-'] .raw-url[href$='.user.js']");
78+
},
79+
submit: function(url, user, description, files, stars, forks, revisions){
80+
return (document.querySelector(".bubble[id^='file-'] .raw-url[href$='.user.js']") || { href: ""}).href.trim();
81+
},
82+
icon: "http://wiki.greasespot.net/favicon.ico"
83+
}
84+
};
85+
86+
function addMenuItem() {
87+
var link, url, menu, li, user, description, files, stars, forks, revisions;
88+
89+
if ((link = document.querySelector("[name='link-field']")) && (menu = document.querySelector('ul.menu.gisttabs'))) { // check if we're on an actual gists;
90+
url = link.value;
91+
user = document.querySelector(".author.vcard").textContent.trim();
92+
description = (document.querySelector(".gist-description") || document.querySelector(".js-current-repository") || { textContent: ""}).textContent.trim();
93+
files = document.querySelectorAll(".bubble[id^='file-']").length;
94+
stars = (menu.querySelector("a[href$='/stars'] .counter") || { textContent: ""}).textContent.trim();
95+
forks = (menu.querySelector("a[href$='/forks'] .counter") || { textContent: ""}).textContent.trim();
96+
revisions = (menu.querySelector("a[href$='/revisions'] .counter") || { textContent: ""}).textContent.trim();
97+
98+
menu.appendChild(li = document.createElement("li"));
99+
li.id = "Github_Gist_Share";
100+
101+
for(var key in socials){
102+
var social = socials[key],
103+
socialA = document.createElement("a"),
104+
socialImg = document.createElement("img");
105+
106+
if (social.show(url, user, description, files, stars, forks, revisions) !== true) continue;
107+
108+
li.appendChild(socialA);
109+
socialA.appendChild(socialImg);
110+
socialA.id = String.format("{0}_{1}", li.id, key.replace(/\s+/g, "_"));
111+
socialA.href = social.submit && social.submit(url, user, description, files, stars, forks, revisions);
112+
socialA.title = String.format("[{0}] {1}", key, socialA.href);
113+
socialA.style.display = "inline-block";
114+
socialA.target = "_blank";
115+
socialImg.src = social.icon;
116+
socialImg.alt = key;
117+
}
118+
}
119+
}
120+
121+
// init;
122+
addMenuItem();
123+
124+
// on pjax;
125+
$(document).on("pjax:success", addMenuItem);
126+
127+
128+
129+
// ==UserStats==
130+
// Chars (excl. spaces): 4.076
131+
// Chars (incl. spaces): 4.740
132+
// Words: 473
133+
// Lines: 134
134+
// ==/UserStats==

Github_Gist_Share/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Github Gist Share](http://userscripts.org/scripts/show/157850)

0 commit comments

Comments
 (0)