I hereby claim:
- I am sscotth on github.
- I am sscotth (https://keybase.io/sscotth) on keybase.
- I have a public key whose fingerprint is 61AD 95F1 60FF C3FA A93A 0C86 E12E C4E0 BACA 0F74
To claim this, I am signing this object:
' Comment | |
Sub Mac1() | |
ActiveSheet.PageSetup.LeftFooter = "&08&A" | |
ActiveSheet.PageSetup.RightFooter = "&08&Z&F" | |
End Sub |
How to remove consecutive new lines: search for ^(.*)(\r?\n\1)+$ and replacing with \1 |
// Cross-browser xml parsing | |
var parseXML = function( data ) { | |
var xml, tmp; | |
if ( !data || typeof data !== "string" ) { | |
return null; | |
} | |
try { | |
if ( window.DOMParser ) { // Standard | |
tmp = new DOMParser(); | |
xml = tmp.parseFromString( data , "text/xml" ); |
I hereby claim:
To claim this, I am signing this object:
{ | |
"rules": { | |
"users": { | |
"$uid": { | |
".write": "auth !== null && auth.uid === $uid", | |
".read": "auth !== null && auth.uid === $uid" | |
} | |
} | |
} | |
} |
var beginTime = new Date() | |
function displayTimer(){ | |
var secondsSinceBegin = moment.duration( Date.now() - beginTime ).asSeconds(); | |
var formatAsTimer = moment().hour(0).minute(0).second(secondsSinceBegin).format('H:mm:ss'); | |
console.log(formatAsTimer); | |
} | |
setInterval(displayTimer, 1000); |
OSX: brew install s3cmd
Debian/Ubuntu: apt-get install s3cmd
Other: Download from http://s3tools.org/s3cmd
s3cmd --configure
Run irb
and execute the following commands with your bucket name and AWS secret key. You will need to save the encoded_policy string and the signature.
require 'base64'
require 'openssl'
require 'digest/sha1'
aws_secret_key = 'SKYBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXJoYL'
function Game(numberOfPlayers){ | |
this.weapons = []; | |
this.weapons.push(new Weapon({name: 'Sword', damage: 0.2, ammo: Infinity})); | |
this.weapons.push(new Weapon({name: 'Shotgun', damage: 0.6, ammo: 1})); | |
this.weapons.push(new Weapon({name: 'Fist', damage: 0.05, ammo: Infinity})); | |
this.players = []; | |
for (var i=0; i < numberOfPlayers; i++){ | |
var player = new Player; |
function Pirate() { | |
this.says = 'ARRRRRRRRRRRRRR!'; | |
this.toString = function() { return 'Pirate'; }; | |
} | |
function Ninja() { | |
this.says = ''; | |
this.toString = function() { return 'Ninja'; }; | |
} |