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
# 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
# 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
/* | |
* 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
# 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
#!/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
Open iTerm2 over full-screen'd apps (HACK) | |
------------------------------------------ | |
READ: https://gitlab.com/gnachman/iterm2/issues/1570 | |
defaults write /Applications/iTerm.app/Contents/Info LSUIElement true | |
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 deflate(hash) | |
hash.collect do |k,v| | |
[k.to_s].push v.is_a?(Hash) ? v.to_a.flatten : v | |
end.flatten.collect(&:to_s).sort | |
end | |
event1 = { foo: 'bar', bars: [4,6,10] } | |
event2 = { bars: [10,4,6], foo: 'bar' } | |
event1 == event2 |
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 ruby | |
require 'capybara' | |
require 'capybara/poltergeist' | |
class Scraper | |
include Capybara::DSL | |
Capybara.register_driver :poltergeist do |app| | |
Capybara::Poltergeist::Driver.new app, | |
phantomjs_options: ['--load-images=no','--ignore-ssl-errors=yes'], | |
js_errors: false, |
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 | |
################################################## | |
# Bash Prompt | |
################################################## | |
# Current configuration produces: | |
# 00:00:50 jeff@edison:~/Dev/humani.se (git:master:156d0b4) ruby-2.2.0 | |
# → _ |