I hereby claim:
- I am at1as on github.
- I am willems (https://keybase.io/willems) on keybase.
- I have a public key ASBJanSm1SKbTunlyBBTt_3BFB8mjHGMiLPmvpjFRO9Zlwo
To claim this, I am signing this object:
-module(bits). | |
-export([bits/1, bitsNoTailRecursion/1, startTests/0]). | |
%% Functional Programming in Erlang | |
%% Kent University | |
%% 21 February 2017 | |
%% Exercise 1 : Summing the Bits | |
%% |
#!/bin/bash | |
# Usage : ./facetime_kill.sh 10 | |
# Accepts 1 argument : a number of seconds before stopping app | |
if [[ $1 ]] | |
then | |
echo "Killing Facetime in ${1} seconds" | |
i=$1 | |
jason$ echo "a, b, c and d. e, f, g, and h" | sed 's/\([^,]\)\(\ and\)/\1\,\2/g' | |
> a, b, c, and d. e, f, g, and h |
#!/bin/bash | |
# Generate a valid Social Security Number | |
function generate() { | |
SSN="" | |
valid=0 | |
for i in {1..9}; do | |
DIGIT=$[RANDOM%9+1] |
I hereby claim:
To claim this, I am signing this object:
# A Natural Sort Algorithm in one line | |
ITEMS = %W(item1 item2 item11 item1 item20 item3 hello other_item other_item7 item) | |
TRAILING_NUM = /[0-9]*\Z/ | |
natural_sorted = ITEMS.sort.chunk{ |y| y.gsub(TRAILING_NUM, '') }.to_a.map{ |k_v| k_v[1] }.each{ |x| x.sort_by!{ |z| z.scan(TRAILING_NUM).first.to_i }}.flatten | |
puts natural_sorted | |
# => ["hello", "item", "item1", "item1", "item2", "item3", "item11", "item20", "other_item", "other_item7"] |
/* Paste into your browser console to replace all instances in FaceBook of big 3 Canadian political parties | |
with "Big Government Party" and their leaders with "Big Government Politician" */ | |
function traverseDOM(node, func) { | |
func(node); | |
node = node.firstChild; | |
while (node) { | |
traverseDOM(node, func); | |
node = node.nextSibling; | |
} |
Create Controller
Generate Model (also creates a migration)
Create Migration
#!/usr/bin/env ruby | |
## Find necessary method for desired result | |
## entering: | |
## jason$ method_find.rb "HELLO" "hello" | |
## returns: | |
## HELLO.downcase == hello | |
## HELLO.swapcase == hello | |