Skip to content

Instantly share code, notes, and snippets.

@jonaslund
jonaslund / gist:2237280
Created March 29, 2012 13:01 — forked from padolsey/gist:527683
JS: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@jonaslund
jonaslund / fbScrape.js
Created August 15, 2012 10:18
Casperjs script to screenshot an entire Facebook Post
// Using Casperjs to screenshot an entire Facebook Post */
var casper = require('casper').create({
clientScripts: [
'jquery.js'
]
});
//login to facebook
casper.start('https://www.facebook.com/', function() {
this.fill('#login_form', { email: 'email', pass: 'password' }, true);
{
"name": "ss",
"version": "0.0.1-60",
"dependencies": {
"socket.io": "0.9.10",
"express": "3.0.x",
"mongodb": "1.1.7"
},
"engines": {
"node": "0.8.x",
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: socket hang up
error: at createHangUpError (http.js:1263:15)
error: at Socket.socketOnEnd (http.js:1351:23)
error: at TCP.onread (net.js:418:26)
help: For help with this error contact Nodejitsu Support:
help: webchat: <http://webchat.nodejitsu.com/>
help: irc: <irc://chat.freenode.net/#nodejitsu>
@jonaslund
jonaslund / consoleblur.js
Created October 17, 2012 20:48
Blur the console log
var _log = console.log;
console.log = function() {
_log.call(console, '%c' + [].slice.call(arguments).join(' '), 'color:transparent;text-shadow:0 0 2px rgba(0,0,0,.5);');
};
@jonaslund
jonaslund / .zshrc
Created November 12, 2012 01:05
zsh config
# Path to your oh-my-zsh configuration.
ZSH=$HOME/v/oh-my-zsh
# Set name of the theme to load.
ZSH_THEME="mgutz"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Comment this out to disable weekly auto-update checks
@jonaslund
jonaslund / script.js
Created November 20, 2012 20:40
A CodePen by Tristan. Lightrays v2 - Added some colour. Update: Added colour shift for sun-rise/set.
var canvas, c, w, h,
twoPI = Math.PI * 2,
mX, mY,
resize = true,
mousemove = true,
per = { x: 0, y: 0 },
mtn, trackmouse = false;
window.onload = function(){
canvas = document.createElement('canvas')
@jonaslund
jonaslund / index.html
Created November 20, 2012 20:41
A CodePen by Jack Rugile. Canvas Orbital Trails - Click and drag anywhere on the screen to create new trails.
<div id="control-panel">
<p>Click and drag to make more!</p>
<label>Trails: </label>
<input type="checkbox" id="trail" name="trail" checked/>
<button id="clear">Clear</button>
</div>
<canvas id="c"></canvas>
@jonaslund
jonaslund / index.html
Created November 20, 2012 20:42
A CodePen by AKM2. Painting - http://jsdo.it/akm2/zAOw
<div id="message">Drag mouse to paint.</div>
<canvas id='c'></canvas>
@jonaslund
jonaslund / paypal-php-howto.php
Created February 7, 2013 19:51
Paypal For Paolo
<!-- the form -->
<?php
$paypalURL = "https://www.paypal.com/cgi-bin/webscr";
$paypalSandBox = "https://www.sandbox.paypal.com/cgi-bin/webscr";
?>
<form action="<?php echo $paypalSandBox ?>?sandbox=1" method="post" class="hidden payPalForm">
<div>
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="item_name" value="" />