Skip to content

Instantly share code, notes, and snippets.

View jkup's full-sized avatar

Jon Kuperman jkup

View GitHub Profile
### Keybase proof
I hereby claim:
* I am m1ck3y on github.
* I am jkuperman (https://keybase.io/jkuperman) on keybase.
* I have a public key whose fingerprint is 6CB2 9832 5521 F909 9628 158F 536E 2E1B B117 AC5E
To claim this, I am signing this object:
# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix
# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
def capitalizeAll(args: String*) = {
args.map (_.capitalize)
}
capitalizeAll("hello", "goodbye", "farewell")
// --vs--
function capitalizeAll(Array $words) {
return array_map(function($word) {
@jkup
jkup / deep-learning-resources.md
Last active August 29, 2015 14:13
Deep Learning Resources
@jkup
jkup / index.js
Created April 24, 2015 18:02
Why would you do this?
(function() {
var foo = new $.Deferred();
function bar() {
doSomething();
foo.resolve();
}
$.when(foo).then(function() {
doSomethingElse();
@jkup
jkup / index.js
Last active October 5, 2015 01:11
JavaScript multiline string regex
var string = "www.one \
www.two \
www.three";
var pattern = /^(www\.)\w+/gm;
console.log(string.match(pattern));
@jkup
jkup / index.jsx
Created December 15, 2015 23:47
React Question
<div className={(condition) ? 'grid-item Rejection Rejection--width2' : 'grid-item Rejection'}>
// How can I do this without repeating the grid-item and Rejection classes?
// Something like:
//<div className={"grid-item Rejection" if (condition) { "Rejection--width2" }}>
@jkup
jkup / chdir.js
Created March 28, 2016 00:08
Change Directory
#!/usr/bin/env node
const process = require('process')
process.chdir('/foo')
console.log(process.cwd()) // This logs foo
// but then if I run this my terminal doesn't change
@jkup
jkup / index.js
Last active April 20, 2016 22:18
JavaScript try-catch
var a, b, c;
try {
b = 'foo';
a = nonExistent;
c = 'bar';
} catch(e) {}
console.log(a, b, c); // 'foo', undefined, undefined
@jkup
jkup / example.js
Last active June 11, 2016 06:31
Sometimes it's wild how different my JavaScript looks from a few years ago
'use strict'
import React from 'react'
import { StyleSheet, css } from 'aphrodite'
class ToDoList extends React.Component {
constructor (props) {
super(props)
this.displayName = 'ToDoList'