This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Forget You | |
// @namespace about:blank | |
// @description Makes sure that users are never remembered, this being a public computer. | |
// ==/UserScript== | |
// Created by Ryan O'Hara (minitech), a customer. | |
// Enjoy my first Greasemonkey script! | |
// http://git.io/ry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The data | |
var items = document.getElementsByTagName('p'); | |
// The old way | |
var arr = Array.prototype.slice.call(items); | |
// Pros: | |
// - Doesn't need a helper method that loops through stuff | |
// | |
// Cons: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey @animuson - does this get highlighted? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(a){function r(c){return c.split('').map(function(x){return String.fromCharCode(x.charCodeAt(0)^9)}).join('');}a="IW98Z2p9YGZnIWggcm98Z2p9YGZnKXshaiBye2x9fHtnKWonenllYH0hLi4gJ2RoeSFvfGdqfWBmZyFxIHJ7bH18e2cpWn17YGduJ297ZmRKYWh7SmZtbCFxJ2phaHtKZm1sSH0hOSBXPiB0ICdjZmBnIS4uIDJ0aDQrb2JrfHomLFpmZ30uZ30ueWZ3Lndhey59ZmF7YmpgKXouZHt9ei5+b316ay58b2BqYWMufW18Z356fS5nYHphLndhe3wubHxheX1rfCAuSmFgKXoueWF8fHciLkcuamdqYCl6LmphLm9gd3pmZ2BpICAgLnpmZ30uemdjayAsJysybH9oZSF7IWggIDJ0ISAgMg==";eval(r(atob(a)));}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Andrew Stewart wants this: | |
// http://stwrt.ca/HVpT | |
// in JavaScript. Concisely. | |
function temperature_icon(temp) { | |
if(temp < -40 || temp > 30) return 'E'; | |
return ')_+QW'.charAt( | |
(temp > 0) | |
+ (temp > 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function PasswordHash($data, $salt) { | |
$result = ''; | |
for($i = 0; $i < 2000; $i++) { | |
$result = hash('sha512', $salt . $result . $data); | |
} | |
return $result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A grouping function for JavaScript. | |
// Created by Ryan O'Hara. | |
// Usage: | |
// group([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(x) { return x % 2; }); | |
// group({a: 20, b: 30, c: 40, d: 50}, function(x) { return x % 20; }); | |
// Result: | |
// [[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]] | |
// [{a: 20, c: 40}, {b: 30, d: 50}] | |
function group(obj, func, thisArg) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# My first Python program. | |
# Feedback please; anything non-Pythonic here? | |
manga = raw_input("Enter the slug name of the manga: ") | |
while True: | |
try: | |
start = int(raw_input("Start chapter: ")) | |
break | |
except ValueError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This C is pretending to be Ruby. | |
// Yeah, I know the ifs aren't quite right. Oh well. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdarg.h> | |
#define puts );printf("%s\n", | |
#define gets _gets() | |
#define if );if( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function calculateTotal(boxes, total) { | |
boxes.find('option:selected').each(function() { | |
var m = /\[\+ \$(\d+\.\d+)\]/.exec(this.value); | |
if(m !== null) { | |
total += +m[1]; | |
} | |
}); | |
var decimalPart = (total - Math.floor(total)) * 100; |
OlderNewer