I hereby claim:
- I am andrewbranch on github.
- I am andrewbranch (https://keybase.io/andrewbranch) on keybase.
- I have a public key whose fingerprint is 3F80 A965 F914 BC02 8650 E395 22CC A4B1 20C4 27D2
To claim this, I am signing this object:
// Drop ModelWithEnum.ThingTypeDictionary into a ViewModel that gets serialized to JSON | |
// for handy, scalable use of enums in JavaScript. For example, you can change | |
// | |
// | |
// if (m.ThingTypeId === 3) | |
// | |
// to | |
// | |
// if (m.ThingTypeId === model.ThingTypeDictionary.Spaceship) |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
using App.Utilities; | |
namespace App.Helpers | |
{ | |
public static class ActionResultExtensions | |
{ |
class RadioView: UIView { | |
var selected: Bool = false { | |
didSet { | |
UIView.animateWithDuration(self.fadeTime) { | |
self.inner.alpha = self.selected ? 1 : 0 | |
} | |
} | |
} | |
var trash = []; | |
function computationallyIntensiveStuff() { | |
trash.push(Math.pow(Math.pow(Math.cos(Math.sin(Math.random())), Math.random()), Math.random() * 100000)); | |
trash.filter(function (a) { return a > Math.random(); }); | |
} | |
new Promise(function (resolve, reject) { | |
for (var i = 0; i < 1000; i++) { |
I hereby claim:
To claim this, I am signing this object:
someAsyncMethod() { | |
return new Promise((resolve, reject) => { | |
somePromiseReturningMethod().then(x => { | |
resolve(doSomethingTo(x)); | |
}); | |
}); | |
} |
function getTestPeople() { | |
return [{ | |
name: "Kylie", | |
age: 18 | |
}, { | |
name: "Andrew", | |
age: 23 | |
}, { | |
name: "Andrew", | |
age: 18 |
// filtered is an Immutable.Seq (lazy sequence) with 307 entries | |
let withinCountry = filtered.filter(p => p.get('locations').some(isSameCountry(yourLocation))); | |
let outsideCountry1 = filtered.filter(p => !withinCountry.includes(p)); | |
let outsideCountry2 = filtered.filter(p => !p.get('locations').some(isSameCountry(yourLocation))); | |
let outsideCountry3 = filtered.toSet().subtract(withinCountry); | |
return withinCountry.sort(someWayOfSorting) | |
.concat(outsideCountryN.sort(someOtherWayOfSorting)) | |
.take(10); |
import { describe, it, beforeEach } from 'mocha'; | |
import assert from 'assert'; | |
import transposeArray from './transpose-array'; | |
describe('transpose-array', () => { | |
let array; | |
beforeEach(() => array = [0, 1, 2, 3, 4, 5]); | |
it('works for downward transpositions', () => { | |
let result = transposeArray(array, 4, 2); |
# $Id: avrdude.conf.in 1371 2016-02-15 20:15:07Z joerg_wunsch $ -*- text -*- | |
# | |
# AVRDUDE Configuration File | |
# | |
# This file contains configuration data used by AVRDUDE which describes | |
# the programming hardware pinouts and also provides part definitions. | |
# AVRDUDE's "-C" command line option specifies the location of the | |
# configuration file. The "-c" option names the programmer configuration | |
# which must match one of the entry's "id" parameter. The "-p" option | |
# identifies which part AVRDUDE is going to be programming and must match |