Skip to content

Instantly share code, notes, and snippets.

View glifchits's full-sized avatar

George Lifchits glifchits

View GitHub Profile
@glifchits
glifchits / reduce-all-the-things.js
Created September 25, 2017 19:19
map, filter from reduce
function mapper(fn, arr) {
return arr.reduce((acc, i) => [...acc, fn(i)], [])
}
function filterer(pred, arr) {
return arr.reduce((acc, i) => pred(i) ? [...acc, i] : acc, [])
}
console.log(mapper( x => x ** 2, [1, 2, 3] )) // => [1, 4, 9]
console.log(filterer( x => x >= 2, [1, 2, 3] )) // => [2, 3]
@glifchits
glifchits / index.html
Last active August 29, 2015 14:10
Google Inbox button animation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Google Inbox button animation</title>
<style>
.btn {
margin: 30px;
background-color: #db4437;
position: relative;
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import requests
base_url = 'http://letsrevolutionizetesting.com/challenge.json'
r = requests.get(base_url)
print r.json()
@glifchits
glifchits / clever-demo.ipynb
Last active August 29, 2015 13:57
IPython notebook interacting with the Clever demo API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am glifchits on github.
  • I am george (https://keybase.io/george) on keybase.
  • I have a public key whose fingerprint is DE09 D386 BFA4 87FA D80A 8522 EE96 80CA 290E A9CD

To claim this, I am signing this object:

@glifchits
glifchits / vim.rb
Created September 27, 2013 20:21 — forked from mgrouchy/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end