Skip to content

Instantly share code, notes, and snippets.

@terakilobyte
terakilobyte / gist:0279bdf87e471e62b360
Created May 23, 2015 17:50
Upper case an array or comma separated list
var UpperCase = function(args) {
if (!Array.isArray(args)) {
args = [].slice.call(arguments);
}
return args.map(function(elem) {
return elem.toUpperCase();
});
}
@terakilobyte
terakilobyte / NavBar.jsx
Last active August 29, 2015 14:22
NavBar responsive buttons and dropdown
/**
* Created by nathanleniz on 6/4/15.
*/
if (Meteor.isClient) {
$(document).ready(function() {
$(".dropdown-button").dropdown({
inDuration: 300,
outDuration: 225,
constrain_width: false,
JavaScript resources, all free online. They're ordered in diffuculty from top to bottom.
http://jsforcats.com/
https://www.youtube.com/playlist?list=PLeL6uTxQ-uX_5BpOb2FDNgG6SxjCs59Kv
https://www.youtube.com/watch?v=hQVTIJBZook
https://www.khanacademy.org/computing/computer-science/algorithms
http://speakingjs.com/es5/index.html
http://eloquentjavascript.net/index.html
http://superherojs.com/
https://www.youtube.com/watch?v=8aGhZQkoFbQ
@terakilobyte
terakilobyte / Proposal
Created June 10, 2015 20:55
JS Curriculum
1. Variable Types (Primitive/Object)
2. Logical Operators
3. Branch Statements (If/Else/Switch)
4. Arrays (Basic)
5. Loops (For/While)
6. Functions (Basic)
7. Objects (Basic)
8. Arrays and Objects (Intermediate)
9. Scope
10. This keyword
@terakilobyte
terakilobyte / vim.bundles
Created June 17, 2015 13:34
vim settings
if &compatible
set nocompatible
end
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
" Let Vundle manage Vundle
Plugin 'gmarik/Vundle.vim'
@terakilobyte
terakilobyte / gcd
Last active August 29, 2015 14:23
Etudes 4dash2
defmodule Etudes4 do
@moduledoc """
Etudes chapter 4
"""
@doc """
Calculates the greatest common divisor of two integers using the Dijkstra
algorithm.
Examples:
@terakilobyte
terakilobyte / ** (CondClauseError) no cond clause evaluated to a true value
Created October 26, 2015 04:20
** (CondClauseError) no cond clause evaluated to a true value
Enum.reduce(sentence, %{},
fn(word, acc) ->
cond do
Map.has_key?(acc, word) ->
acc = Map.update(acc, word, 1, &(&1 + 1))
true
acc = Map.put(acc, word, 1)
end
end
)
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory