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
cd path/to/project/public | |
php -S localhost:8080 index.php |
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
# 'git status' alias function | |
function gs { | |
git status $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
require 'mqtt/client' | |
mqtt = MQTT::Client.new('10.25.2.4') | |
loop do | |
mqtt.connect do |c| | |
c.publish('test/foo/bar','this is a test message #{Time.now}') | |
puts "published a msg" | |
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
/* | |
* Jsgauge 0.4.1 | |
* http://code.google.com/p/jsgauge/ | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* Tweaked by Mark Embling (http://markembling.info/) to use requestAnimationFrame instead of setTimeout. | |
*/ | |
/*jslint browser: 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
irb(main):004:0> require 'json' | |
=> true | |
irb(main):005:0> data = { "timestamp" => Time.new } | |
=> {"timestamp"=>2011-07-13 13:55:29 +0100} | |
irb(main):006:0> json = data.to_json | |
=> "{\"timestamp\":\"2011-07-13 13:55:29 +0100\"}" | |
irb(main):007:0> deserialised = JSON.parse json | |
=> {"timestamp"=>"2011-07-13 13:55:29 +0100"} | |
irb(main):008:0> deserialised["timestamp"].class | |
=> String |
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 would (does) work in proper browsers. | |
jQuery(createElement('form')) | |
.attr({'method':'post','action':/*some url*/}) | |
.submit(); | |
// IE needs it to be attached to the document somewhere first before submission will work. :( | |
var f = jQuery(createElement('form')) | |
.attr({'method':'post','action':/*some url*/}); | |
jQuery('body').append(f); | |
f.submit(); |
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
[Bb]in | |
[Oo]bj | |
*.suo | |
TestResult.xml | |
*.sln.cache | |
*.[Rr]e[Ss]harper.user | |
_ReSharper* | |
*.csproj.user |
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
# Start the MongoDB server running (foreground) | |
function Start-MongoD { | |
$dropBox = (Resolve-Path '~\Documents\My Dropbox').Path | |
$mongoConfig = "$dropBox\Software\MongoDB\mongo.conf" | |
$mongoData = "$dropBox\Software\MongoDB\data\" | |
& $dropBox\Software\MongoDB\bin\mongod.exe --config "'$mongoConfig'" --dbpath "'$mongoData'" | |
} | |
# Start the MongoDB client app |
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
// Gets all items more expensive than £5. | |
var q = mongoContext.Query<Item>() | |
.Where(x => x.Price) | |
.IsGreaterThan(5); | |
// Gets all Smiths in the given cities. | |
var q2 = mongoContext.Query<Customer>() | |
.Where(x => x.Name).IsEqualTo("Smith") | |
.Where(x => x.City).IsIn("Bournemouth","Farnborough","London"); |
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
mklink /D ".\WindowsPowershell" ".\My Dropbox\PowershellProfile" |