Skip to content

Instantly share code, notes, and snippets.

View STRd6's full-sized avatar
🍑
https://whimsy.space

Daniel X Moore STRd6

🍑
https://whimsy.space
View GitHub Profile
Hello this is a test

Keybase proof

I hereby claim:

  • I am strd6 on github.
  • I am danielx (https://keybase.io/danielx) on keybase.
  • I have a public key ASC8LhNkWD02QHx2inQw_CTsDiy0iw2mBv4DPTaoTYVf1wo

To claim this, I am signing this object:

@STRd6
STRd6 / heroku.coffee
Created June 13, 2016 17:19
Make requests to the Heroku API from the browser. Note accept and authorization headers.
APIGenerator = require "./api_generator"
{extend} = require "../source/util"
module.exports = (ajax) ->
requester = (path, options={}) ->
options = extend
url: path
method: "GET"
dataType: "json"
@STRd6
STRd6 / reflect_angle.coffee
Created November 4, 2015 15:38
Reflect Angle
reflect = (normal, incident) ->
2 * normal - incident
require 'faye/websocket'
require "sinatra/activerecord"
class Pubsub
KEEPALIVE_TIME = 15 # in seconds
def initialize(app)
@app = app
@clients = []
@channel = "test"
<meta charset="utf-8">
<style >*{
margin
:0;}
a {color : gold }
[e] {font-weight : bold }
[s] {white-space : pre }
[t] {text-decoration : overline }
@STRd6
STRd6 / .bash_prompt
Created October 2, 2014 17:51
.bash_prompt
YELLOW="\[\033[0;33m\]"
GRAY="\[\033[0;34m\]"
RESET="\033[0;00m"
if [ -z "$COMP_SYM" ]; then
COMP_SYM="♥"
fi
PS1="\n\! \[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`\]:\w$YELLOW"'`__git_ps1`'"$GRAY \@$RESET\n$COMP_SYM "
#!/bin/bash
set -e
cd component && git pull && cd ..
VERSION=`echo "console.log(require('./package').version)" | node`
script/update_version $VERSION
script/prepublish && script/test && script/standalone
@STRd6
STRd6 / spec.md
Last active June 14, 2017 23:07
Jadelet Spec

Hamlet Spec

Tags

Tags map directly to the DOM tag with that name. If the tag is omitted it is assumed to be a div.

h1
@STRd6
STRd6 / integration.coffee
Last active August 29, 2015 14:03
Using integration to solve greatest contiguous sum problem
integrate = (array) ->
total = 0
array.map (n) ->
total += n
zeros = (array) ->
array.reduce (zeros, n, i) ->
if !(array[i-1] > 0) and n > 0
zeros.push i