Skip to content

Instantly share code, notes, and snippets.

View raws's full-sized avatar
🥯
dabbling in pumpernickel

Ross Paffett raws

🥯
dabbling in pumpernickel
View GitHub Profile
2:02 AM <raws> $ ssh raws@clints-imac
2:02 AM <raws> Clints-iMac raws$ osascript -e "set volume 10"
2:02 AM <raws> Clints-iMac raws$ say -v whisper 'Clint. I am watching you sleeeep'
...
8:30 AM <zap> raws did you make clint's Mac talk all night?
8:30 AM <clint> raws: lol you fuck face
8:30 AM <clint> god damn i thought i was insanew
8:30 AM <clint> i half--woke up when it talked
8:30 AM <clint> but not enough to know whether it was a dream or not
8:30 AM <clint> and then i had dreams telling people about how I thought I had a dream about hearing the mac voice talking to me
class Verifier {
public static boolean verifyInput(int input) {
String inputString = Integer.toString(input);
for (int i=0; i < inputString.length(); i++) {
if (Character.isLetter(inputString.charAt(i)))
return false;
}
return true;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int input;
try {
input = in.nextInt();
} catch (InputMismatchException e) {
System.out.println("You've provided bad input!");
System.exit(1);
}
package Kokeilu;
public class Ohjelma {
public static void main(String[] args) {
String jatko = "k";
while(jatko.equals("k")) {
// ...
}
(WAN)
|
-------------------- ----------------
| Actiontec Router |--- (10/100) ---| Time Capsule |
-------------------- ----------------
| |
| |
(802.11n) (10/100/1000)
| |
| |
@raws
raws / gist:756864
Created December 28, 2010 03:21
Deepest, darkest infobot secrets revealed

Factoid arguments

Arguments are referenced as part of the factoid name itself, and get turned into bits of regex when parsed.

<Raws> infobot, no, starspin $1 is <action> swallows $1 in a violent, ethereal whorl of galactic stardust!
<infobot> Raws: okay
<Raws> ~starspin Mr_Rabies
*infobot swallows Mr_Rabies in a violent, ethereal whorl of galactic stardust!

The literal value of the factoid can then be displayed by prefixing the name with cmd: and substituting (.*?) for your dollar-sign argument(s):

<Kensaki> I'd be rather shocked if i found an ipad under the x-mas tree.
<Raws> Not if you're a well-grounded individual
<Kensaki> Raws you kno the price of those things in norway?
<JunkHead> I'd be shocked to find one under our tree.
<Raws> whoosh
<JunkHead> Mainly because I don't get gifts.:P
<starspun> If I found an iPad under the Christmas tree I'd be like "who left this here?"
<Kensaki> 676 USD for the cheapest version
<starspun> Speaking of Apple products, my cousin tricked his girlfriend so hard @_@
<Raws> That's all well and good, but c'mon, someone throw me a bone for that joke
# Send a reminder to yourself or someone else at some point in the future
# Usage: remind me in 1h 35 mins to check the oven
if args.to_s =~ /^\s*(\S+)\s*in\s*((?:[\d\.]+\s*\w+\s*)+)\s+(\D.*)\s*$/i
target, delay_words, message = *$~[1..3]
target = sender.nick if target =~ /me/i
reminders = get "reminders", []
min, max = 10.seconds, 5.years
unless delay = ChronicDuration.parse(delay_words)
<Gary13579> ffffff HTC
<Gary13579> their fucking stock USB cable that the G1 launched with
<Gary13579> does not have a ferrite core
<Gary13579> so you get a ton of corruption when copying files over USB
<Gary13579> early adopters of android got pretty fucked over
@raws
raws / a7a.rb
Created January 25, 2011 18:17
a7a = args.first || "A7A" # Or: args.empty? ? "A7A" : args.to_s
["#{a7a}", "thermal grease when you say #{a7a}"]