Skip to content

Instantly share code, notes, and snippets.

View emilioriosvz's full-sized avatar
🍍

Emilio Rios emilioriosvz

🍍
View GitHub Profile
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@bmitchelmore
bmitchelmore / inplace-radix.js
Created February 28, 2012 04:52
In Place Radix Sort in Javascript
var nums = [35, 25, 53, 3, 102, 203, 230, 1005];
// Figure out the number of binary digits we're dealing with
var k = Math.max.apply(null, nums.map(function(i) {
return Math.ceil(Math.log(i)/Math.log(2));
}));
for (var d = 0; d < k; ++d) {
for (var i = 0, p = 0, b = 1 << d, n = nums.length; i < n; ++i) {
var o = nums[i];