if (gameHasEnded && !( prizePaidOut ) ) {
winner.send(1000); // send a prize to the winner
prizePaidOut = True;
}
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 AutoScroll | |
// @namespace https://gist.github.com/eykanal/a0b30e035d8c15995deeffec6ab21866 | |
// @version 0.1 | |
// @description Automatically scroll to the bottom of the page | |
// @author Eliezer Kanal | |
// @match https://www.facebook.com/search/str/* | |
// @match https://twitter.com/search* | |
// @grant none | |
// ==/UserScript== |
"Now the way this game works," said the boy, "is that you give me a triplet of three numbers, and I'll tell you 'Yes' if the three numbers are an instance of the rule, and 'No' if they're not. I am Nature, the rule is one of my laws, and you are investigating me. You already know that 2-4-6 gets a 'Yes'. When you've performed all the further experimental tests you want - asked me as many triplets as you feel necessary - you stop and guess the rule, and then you can unfold the sheet of paper and see how you did. Do you understand the game?"
"Of course I do," said Hermione.
"Go."
"4-6-8" said Hermione.
"Yes," said the boy.
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
#!/bin/sh | |
# move to correct directory | |
currDir=pwd | |
cd /Users/eliezerk/Documents/Research-grad/thesis/thesis-tex-svn/ | |
# get current revision | |
revisions=`svnversion | sed 's/^[A-Z0-9]*://'` | |
isModified=`echo $revisions | sed -e 's/^[0-9A-Z]*://' -e 's/[0-9]//g'` | |
if [ "$isModified" = "M" ] ; then |
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 Toodledo Add Goal Count | |
// @namespace | |
// @include http://www.toodledo.com/organize/goals.php | |
// @include https://www.toodledo.com/organize/goals.php | |
// ==/UserScript== | |
// for each higher-order goal: | |
// count how many lower-order goals have that stated as a higher-order goal | |
// display that number next to the higher-order goal |
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
#!/bin/sh | |
# | |
# The script should be run with the directory containing files to be analyzed. | |
# For each file in that directory, the script will run maxfilter with the | |
# parameters defined below, and save it to the output directory defined in | |
# SAVE_DIR. It will then email the address specified at the bottom | |
# ([email protected]) with the analysis log, containing the results of the | |
# analysis. | |
# |
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
#!/usr/bin/ruby | |
gitconfig = File.expand_path("~/.gitconfig") | |
if File.file?(gitconfig) | |
puts "#{gitconfig} already exists." | |
exit 0 | |
end | |
puts('##', |
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
#!/usr/bin/ruby | |
if File.exists?(File.expand_path("~/.gitconfig")) | |
puts "~/.gitconfig file already exists, exiting." | |
exit false | |
end | |
puts '##' | |
puts '## Git stores each entry with your name, email, and a unique identifier.' | |
puts '## The following will set up Git with this information, as well as some ' |
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
#!/bin/sh | |
# How full should the disk be allowed to get (percentage)? | |
warn_at=90 | |
# get disk space info for all disks | |
df | grep "/dev/disk" | awk '{ print $1,$3,$4,$5,$6 }' > /tmp/space | |
# for each disk, determine if full | |
while read line |
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
#!/bin/sh | |
# How many seconds does it usually take your site to respond? | |
sec=2 | |
# Try to download the site to a file | |
curl -s -m $sec example.org > /tmp/dltime | |
# Get size of file | |
a=`wc -m /tmp/dltime | awk '{print $1}'` |