This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# First install homebrew and cask | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install cask brew-cask | |
# Applications | |
brew cask install 1password | |
brew cask install anvil | |
brew cask install atom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if we want to check whether a particular value is in an array, we have | |
# a couple options... Most times simply calling array.include?(element) is | |
# sufficient, but we can also get creative by using the splat function | |
# with a case statement to check multiple arrays ;) | |
hondai = ['hondai', 'acura', 'civic', 'element', 'fit', ...] | |
toyota = ['toyota', 'lexus', 'tercel', 'rx', 'yaris', ...] | |
case car | |
when *toyota then # Do something for Toyota cars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed and saved. | |
* | |
* Add your own CSS or Less to fully customize Atom. | |
* If you are unfamiliar with Less, you can read more about it here: | |
* http://lesscss.org | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
fs = require 'fs' | |
path = require 'path' | |
nodeCLI = require '/usr/local/lib/node_modules/shelljs-nodecli' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 100_000 users | |
# Rehearsal --------------------------------------------------- | |
# SQL Conditional 3.910000 0.060000 3.970000 ( 3.991377) | |
# AR Conditional 4.930000 0.050000 4.980000 ( 4.971518) | |
# ------------------------------------------ total: 8.950000sec | |
# | |
# user system total real | |
# SQL Conditional 3.760000 0.030000 3.790000 ( 3.800231) | |
# AR Conditional 4.910000 0.040000 4.950000 ( 4.957218) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
########################### | |
# AppleScripts | |
########################### | |
# Change the background color and alpha of the current terminal window (formatted to be the same as RGBA). | |
function iterm_bg { | |
local R=$1 | |
local G=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'io/console' | |
require 'optparse' | |
require 'ostruct' | |
require 'fileutils' | |
NAME = "Safari Keyword History Index Parser" | |
VERSION = "v0.0.1" | |
TIME = Time.now | |
def box_me_up(str) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Examples: | |
# | |
# ps1_set --prompt ∴ | |
# | |
# This will yield a prompt like the following, for example, | |
# | |
# 00:00:50 jeff@edison:~/dev/humani.se (git:master:156d0b4) ruby-2.2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hex_to_rgba(input, alpha=1) | |
components = (input.match /#?([0-9A-F]{2})/ )[1..3] | |
components.map!{ |x| x + x } if input.size == 4 | |
"rgba(#{components.collect(&:hex).join(',')},#{alpha})" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'open-uri' | |
dir = Dir.pwd | |
url = "some_url" | |
data = Nokogiri::HTML(open(url)) | |
data.css('a').each do |link| | |
filename = link['href'] | |
if filename =~ /^BD/ |