Skip to content

Instantly share code, notes, and snippets.

@bytezen
bytezen / destructuring.md
Created February 25, 2017 09:07 — forked from yang-wei/destructuring.md
Elm Destructuring (or Pattern Matching) cheatsheet

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))

let
  (a,b,c) = myTuple
@bytezen
bytezen / magicCardTrick.js
Created February 14, 2017 20:23
IML400-Magic Card Trick Getting Started
//the number between 1-27
var favoriteNumber = 10;
// a list of 27 cards; here I am using
// S = spades, C = clubs, D = diamonds, H = hearts
var cards = ["2C","3C","4C",
"5C","6C","7C",
"8C","9C","10C",
"2S","3S","4S",
"5S","6S","7S",
"8S","9S","10S",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="jquery-3.1.0.js"></script>
</head>
<body>
</body>
@bytezen
bytezen / spotify-get-id.js
Last active September 30, 2016 16:46
This is the spotify example
// This is the last example that we did in class where we get the artist ID for
// Billy Joel.
// In order for this to work you need to have the code from the spotify-sandbox.js gist below
// loaded into the console.
// The documentation for the search endpoint is here: https://developer.spotify.com/web-api/search-item/
var searchURL = "https://api.spotify.com/v1/search";
//Note we could have intialized this params object all at once like so:
@bytezen
bytezen / watch.sh
Created February 13, 2016 17:14 — forked from mikesmullin/watch.sh
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <mike@smullindesign.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
@bytezen
bytezen / git_cribsheet.md
Created February 2, 2016 00:13
IML400 Cribsheet for adding files to repo from command line

To commit stuff to your repo

0)...to change your website make sure that you are on the gh-branches branch ..say what???

enter: git branch what you want to see is '* gh-pages'

-- gh-pages is the branch (i.e. part of your repo) that has your website

@bytezen
bytezen / Intro.md
Last active February 2, 2016 00:25
IML 400 WhoDat Workshop Scratch Pad

Intro

This is a gist for code snippets that I used and we developed in class. You access these the same way you do a normal git repository: by cloning and pulling changes.

@bytezen
bytezen / css_colors.js
Created February 1, 2016 19:58 — forked from bobspace/css_colors.js
All of the CSS Color names as an array in javascript.
// CSS Color Names
// Compiled by @bobspace.
//
// A javascript array containing all of the color names listed in the CSS Spec.
// The full list can be found here: http://www.w3schools.com/cssref/css_colornames.asp
// Use it as you please, 'cuz you can't, like, own a color, man.
var CSS_COLOR_NAMES = ["AliceBlue","AntiqueWhite","Aqua","Aquamarine","Azure","Beige","Bisque","Black","BlanchedAlmond","Blue","BlueViolet","Brown","BurlyWood","CadetBlue","Chartreuse","Chocolate","Coral","CornflowerBlue","Cornsilk","Crimson","Cyan","DarkBlue","DarkCyan","DarkGoldenRod","DarkGray","DarkGrey","DarkGreen","DarkKhaki","DarkMagenta","DarkOliveGreen","Darkorange","DarkOrchid","DarkRed","DarkSalmon","DarkSeaGreen","DarkSlateBlue","DarkSlateGray","DarkSlateGrey","DarkTurquoise","DarkViolet","DeepPink","DeepSkyBlue","DimGray","DimGrey","DodgerBlue","FireBrick","FloralWhite","ForestGreen","Fuchsia","Gainsboro","GhostWhite","Gold","GoldenRod","Gray","Grey","Green","GreenYellow","HoneyDew","HotPink","IndianRed","Indigo","Ivory"
@bytezen
bytezen / .tmux.conf
Created January 9, 2016 18:57 — forked from v-yarotsky/.tmux.conf
Mac OS X tmux config
### INSTALLATION NOTES ###
# 1. Install Homebrew (https://github.com/mxcl/homebrew)
# 2. brew install zsh
# 3. Install OhMyZsh (https://github.com/robbyrussell/oh-my-zsh)
# 4. brew install reattach-to-user-namespace --wrap-pbcopy-pbpaste && brew link reattach-to-user-namespace
# 5. Install iTerm2
# 6. In iTerm2 preferences for your profile set:
# Character Encoding: Unicode (UTF-8)
# Report Terminal Type: xterm-256color
# 7. Put itunesartist and itunestrack into PATH
@bytezen
bytezen / web-servers.md
Last active September 3, 2015 04:46 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000