JavaScript Code
var str = "hi";
Memory allocation:
Address | Value | Description |
---|---|---|
...... |
... |
$(window).keydown(function(e){ | |
var next = parseInt(location.pathname.split('/')[2])+1 || 2; | |
var prev = parseInt(location.pathname.split('/')[2])-1; | |
if (e.which === 39) { | |
document.location.href = ('/page/'+next); | |
} else if (e.which === 37) { | |
document.location.href = ('/page/'+prev); | |
} | |
}); |
JavaScript Code
var str = "hi";
Memory allocation:
Address | Value | Description |
---|---|---|
...... |
... |
cd /usr/local/src | |
curl -O http://lynx.isc.org/lynx2.8.7/lynx2.8.7.tar.gz | |
tar -xzvf lynx2.8.7.tar.gz | |
cd lynx2-8-7 | |
./configure --mandir=/usr/share/man | |
make | |
sudo make install |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} }, | |
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} } |
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 100, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : true, // Standard browser globals e.g. `window`, `document`. |
<?php | |
//File: test.php | |
//Create the file SplClassLoader.php and add the contents of this gist https://gist.github.com/221634 | |
//Example: | |
//Class Foo\Bar located in 'src/Foo/Bar.php' | |
require 'SplClassLoader.php'; | |
$autoloader = new SplClassLoader('Foo', 'src'); |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |