Skip to content

Instantly share code, notes, and snippets.

View newswim's full-sized avatar
🦬
Hi

Dan Minshew newswim

🦬
Hi
View GitHub Profile
@vicapow
vicapow / 56GB.js
Last active November 5, 2015 04:50
Was I really just able to allocate 56GB of memory in Google chrome?
var x = [];
for (var i = 0; i < 56; i++) {
x.push(new Uint8Array(1024 * 1024 * 1024));
}
console.log(x.length);
@addyosmani
addyosmani / examples.md
Last active February 23, 2016 18:22
Object.observe() examples from my talk

What are we trying to observe? Raw object data.

// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
 
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
@emiloberg
emiloberg / Snippets.txt
Created October 15, 2015 10:46
Snippets for Uppsala JS
DEMO 1
<StackLayout orientation="vertical">
<Button text="one"/>
<Button text="two"/>
<Button text="three"/>
<Button text="four"/>
<Button text="five"/>
</StackLayout>
@vakrilov
vakrilov / main-page.js
Created March 16, 2015 13:00
Native Script - Setting Gradients
function pageLoaded(args) {
var page = args.object;
if (page.android) {
setGradientAndroid(page);
}
else if (page.ios) {
setGradientIOS(page);
}
}
import React from 'react';
import mui from 'material-ui';
import injectTapEventPlugin from 'react-tap-event-plugin';
import ThemeManager from 'material-ui/lib/styles/theme-manager';
import Colors from 'material-ui/lib/styles/colors';
import MyTheme from './theme.js';
import AppBar from 'material-ui/lib/app-bar';
import List from 'material-ui/lib/lists/list';
import ListItem from 'material-ui/lib/lists/list-item';
@HugoDF
HugoDF / map.js
Last active October 18, 2016 19:00
ES6 map implementation using recursion and destructuring
function map([ head, ...tail ], fn) {
if (head === undefined && !tail.length) return [];
return tail.length ? [ fn(head), ...(map(tail, fn)) ] : [ fn(head) ];
}
@tonymorris
tonymorris / add10.hs
Last active September 21, 2017 22:14
This is how we add 10 to every element in a list
import Control.Applicative
import Control.Monad.ST
import Control.Monad
import Data.STRef
while ::
Monad f =>
f Bool
-> f a
-> f ()
@daveyarwood
daveyarwood / wpgtr-ch3.clj
Created January 27, 2014 00:37
why's (poignant) guide to ruby in clojure - chapter 3
; ex. 1:
(repeat 5 "Odelay!")
; ex. 2:
(when-not (re-find #"aura" "restaurant") (System/exit 0))
; ex. 3:
(map clojure.string/capitalize ["toast" "cheese" "wine"])
; ex. 4:
/**
* A redux middleware for processing Meteor methods
* When an action is dispatched, it will pass through our middleware.
* if denoted a method, we will dispatch the action with readyState of loading
* The method passed in is then called, and dispatches further ready states for success/error
* The reducer shape should include { data, readyState } for use in the UI
* @returns {Function}
*/
export default function methodMiddleware() {
return (next) => {
@gmaclennan
gmaclennan / guyana-volunteer-wifi.md
Last active July 4, 2018 18:43
Long-distance solar-powered wifi in the forests and savannahs of Guyana

Overview

Digital Democracy is looking for a volunteer to help pilot long-distance solar-powered wifi antennaes in indigenous communities in Guyana.

Background

Digital Democracy is working with the Wapichan people in the South Rupununi in Guyana to support them in efforts to secure their ancestral territory and increase their autonomy and self-determination. The Wapichan live in 17 villages and 7 smaller "satellites" in a large semi-natural savannah ecosystem surrounded by tropical forest. Communication between villages and with the outside world is difficult due to limited or no cellphone or internet access. We want to help the Wapichan improve their means of communicating with the rest of the world and communicating and coordinating between villages.

Location