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 Countdown Timer | |
// @namespace http://warseph.com/ | |
// @version 0.11 | |
// @description Add a countdown timer to any page | |
// @author Ezequiel Rabinovich | |
// @match http*://*/* | |
// @grant GM_setValue | |
// @grant GM_getValue | |
// @updateURL https://gist.githubusercontent.com/warseph/69a3332d9268b9e98ad3bda5d8e72ed5/raw/countdown-timer.user.js |
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
### Keybase proof | |
I hereby claim: | |
* I am warseph on github. | |
* I am warseph (https://keybase.io/warseph) on keybase. | |
* I have a public key whose fingerprint is 11A0 22FC FCEA 3689 BECC C906 1CF1 AB20 1FB7 846D | |
To claim this, I am signing this object: |
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
# Move windows between monitors | |
alias mon-left 0 | |
alias mon-right 1 | |
bind left:${hyper} move screenOriginX;screenOriginY screenSizeX;screenSizeY mon-left | |
bind right:${hyper} move screenOriginX;screenOriginY screenSizeX;screenSizeY mon-right |
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
Number::second = Number::seconds = -> this * 1000 | |
Number::minute = Number::minutes = -> this.seconds() * 60 | |
Number::hour = Number::hours = -> this.minutes() * 60 | |
Number::day = Number::days = -> this.hour() * 24 | |
# example | |
setTimeout (-> console.log "You've waited a LONG time"), 1.hour() + 5.minutes() + 10.seconds() # Wait 01:05: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
Q = require 'q' | |
receivePromise = (func) -> | |
(args...) -> Q.spread args, func | |
returnPromise = (func) -> | |
(args...) -> | |
deferred = Q.defer() | |
args.push (val) -> deferred.resolve val | |
func args... |
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 tab_color -d "Sets the tab color in iterm" | |
bash -c "echo -e '\033]6;1;bg;red;brightness;$argv[1]\a \033]6;1;bg;green;brightness;$argv[2]\a \033]6;1;bg;blue;brightness;$argv[3]\a'" | |
end | |
#e.g. tab_color 164 205 56 |
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
var lock; | |
lock = function (object, functionName, lockFunction) { | |
'use strict'; | |
var old; | |
if (object[functionName].locked) { | |
return false; | |
} |
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
// Basic call - apply | |
var test = function (a, b) { | |
return a + b; | |
} | |
test(1, 2); // 3 | |
test.apply(null, [1, 2]); // 3 | |
test.call(null, 1, 2); // 3 | |
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/bash | |
for TODO in `ls $1/*/*.TODO` | |
do | |
printf '\033[34m=================================\n' | |
dirname $TODO | awk '{print toupper($0)}' | |
printf '=================================\033[0m\n' | |
cat $TODO | perl -C -e 'use utf8;' -pe 's/✔/\033[32m✔\033[0m/i' | perl -C -e 'use utf8;' -pe 's/(^[^:]+:$)/\033[31m$1\033[0m/i' | |
echo | |
echo | |
done |
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
// models.js | |
var mongoose = require('mongoose'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
model = mongoose.model; | |
var userSchema = new Schema({ | |
name: String, | |
email: ObjectId, | |
password: String |
NewerOlder