Skip to content

Instantly share code, notes, and snippets.

Scott Feeney graue

Block or report user

Report or block graue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@steveluscher
steveluscher / gist:4b54e08aa1e0536b7cb9
Last active Jan 14, 2019
Proposed abbreviation API for Intl.NumberFormat
View gist:4b54e08aa1e0536b7cb9

Intl.NumberFormat

Syntax

new Intl.NumberFormat([locales[, options]])
Intl.NumberFormat.call(this[, locales[, options]])

Parameters

@bmeck
bmeck / es7-async-await.sweet.js
Last active Aug 29, 2015
sweet.js macro for async function, and the potential async function*
View es7-async-await.sweet.js
//
// This assumes the runner supports
// - generators (for a transpiler see http://facebook.github.io/regenerator/)
// - Promises (for a polyfill see https://github.com/petkaantonov/bluebird)
//
// This does not need outside libraries to be loaded
//
// This survives direct eval semantics, unless you use regenerator, in which case the unwinding will cause variable renaming
//
@jvns
jvns / interview-questions.md
Last active Nov 13, 2019
A list of questions you could ask while interviewing
View interview-questions.md

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@davidbalbert
davidbalbert / cps-map.js
Created Dec 11, 2013
Three implementations of `map` in continuation passing style.
View cps-map.js
(function () {
"use strict";
var first = function (arr, c) {
c(arr[0]);
};
var rest = function (arr, c) {
c(arr.slice(1));
};
@tef
tef / python_ruby.py.rb
Last active Dec 17, 2015
python/ruby quine. changes comment to indicate what it last ran as.
View python_ruby.py.rb
# Python or Ruby
l,p,q=(""and"# Ruby"+10 .chr or"# Python"+chr(10)),'l,p,q=(""and"# Ruby"+10 .chr or"# Python"+chr(10))','print((""and"#{print l;c=39.chr;puts p+44.chr+c+p+c+44.chr+c+q+c;puts q}"or"{}{},{!r},{!r}{}{}".format(l,p,p,q,chr(10),q)))'
print((""and"#{print l;c=39.chr;puts p+44.chr+c+p+c+44.chr+c+q+c;puts q}"or"{}{},{!r},{!r}{}{}".format(l,p,p,q,chr(10),q)))
View total-offset.clj
(defprotocol IOffset
(-offset [x]))
(extend-type js/Element
IOffset
(-offset [x]
[(.-offsetLeft x) (.-offsetTop x)]))
(defprotocol IScroll
(-scroll [x]))
@osuushi
osuushi / pi.js
Last active Dec 14, 2015 — forked from peterc/pi.js
View pi.js
var points_total = 0;
var points_inside = 0;
var x, y, i;
while(true) {
for(i = 0; i < 10000; i++) {
x = Math.random();
y = Math.random();
points_inside += 2 + ~(x*x + y*y);
}
points_total += i;
@peterc
peterc / pi.rb
Created Feb 23, 2013
Calculating pi using the Monte Carlo method
View pi.rb
r = 5
points_total = 0
points_inside = 0
loop do
points_total += 1
x, y = rand * r * 2 - r, rand * r * 2 - r
points_inside += 1 if (x ** 2 + y ** 2) < (r ** 2)
puts "#{points_inside}/#{points_total}: pi == #{4 * points_inside / points_total.to_f}" if points_total % 10000 == 0
@elimisteve
elimisteve / goroutines2.go
Created Jan 3, 2013
Programming Challenge: Launch 4 threads, goroutines, coroutines, or whatever your language uses for concurrency, in addition to the main thread. In the first 3, add numbers together (see sample code below) and pass the results to the 4th thread. That 4th thread should receive the 3 results, add the numbers together, format the results as a strin…
View goroutines2.go
// Steve Phillips / elimisteve
// 2013.01.03
package main
import "fmt"
// intDoubler doubles the given int, then sends it through the given channel
func intDoubler(ch chan int, n int) {
ch <- n*2
View gist:4026073
(defmacro >> [& [first-expr & rest-exprs]]
(if (empty? rest-exprs)
first-expr
`(let [~'it ~first-expr]
(thread-it ~@rest-exprs))))
(>>
[jay john mike chris]
(filter (comp (partial = "new york") :current-city) it)
(group-by :employer it)
You can’t perform that action at this time.