Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
// Sample custom iterator. | |
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558) | |
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468 | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <iterator> | |
#include <cassert> |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
app.get('/', function(req, res){ | |
var ua = req.header('user-agent'); | |
if(/mobile/i.test(ua)) { | |
res.render('mobile.html'); | |
} else { | |
res.render('desktop.html'); | |
} | |
}); |
/** | |
* Use `Array#some` when it is convenient to exit on truthy return values | |
* Use `lodash.forEach` when it is convenient to exit on false (you can cast if necessary with `!!`) | |
*/ | |
var _ = require('lodash'); | |
var numbers = [1, 2, 3, 4, 5, 6]; | |
console.log('Array#forEach (result not as expected)'); |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
/*jslint node: true, forin: true, jslint white: true, newcap: true*/ | |
/* | |
* library | |
* author : Takeshi Iwana | |
* https://github.com/iwatakeshi | |
* license : MIT | |
* Code heavily borrowed from Adam Draper | |
* https://github.com/adamwdraper | |
*/ |
Magic numbers are the first bits of a file which uniquely identify the type of file. This makes programming easier because complicated file structures need not be searched in order to identify the file type.
For example, a jpeg file starts with ffd8 ffe0 0010 4a46 4946 0001 0101 0047 ......JFIF.....G ffd8 shows that it's a JPEG file, and ffe0 identify a JFIF type structure. There is an ascii encoding of "JFIF" which comes after a length code, but that is not necessary in order to identify the file. The first 4 bytes do that uniquely.
This gives an ongoing list of file-type magic numbers.
'use strict'; | |
class Source { | |
constructor(source) { | |
source = source[source.length - 1] === this.EOF ? | |
source : source += this.EOF; | |
this._source = []; | |
for(var i = 0; i < source.length; i++) { this._source[this._source.length] = source[i]; } | |
this._line = 1; |
country_codes = [ | |
%{ iso_3166_1: "AF", name: "Afghanistan" }, | |
%{ iso_3166_1: "AX", name: "Aland Islands" }, | |
%{ iso_3166_1: "AL", name: "Albania" }, | |
%{ iso_3166_1: "DZ", name: "Algeria" }, | |
%{ iso_3166_1: "AS", name: "American Samoa" }, | |
%{ iso_3166_1: "AD", name: "Andorra" }, | |
%{ iso_3166_1: "AO", name: "Angola" }, | |
%{ iso_3166_1: "AI", name: "Anguilla" }, | |
%{ iso_3166_1: "AQ", name: "Antarctica" }, |
Latest News: http://site.api.espn.com/apis/site/v2/sports/football/college-football/news
Latest Scores: http://site.api.espn.com/apis/site/v2/sports/football/college-football/scoreboard