Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# from https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Show full path in Finder title bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool YES
# Show the ~/Library folder
@marshallmick007
marshallmick007 / notify.sh
Last active August 29, 2015 13:56 — forked from jehiah/notify.sh
Ubuntu server boot notification script
#!/bin/bash
#
# *************************************************
# chkconfig: 2345 99 99
# description: notify email address on system boot.
#
# https://gist.github.com/marshallmick007/9025968
# *************************************************
# Installing:
# 1) save as /etc/init.d/notify
@marshallmick007
marshallmick007 / keybase.md
Last active April 8, 2016 21:43
keybase.md

Keybase proof

I hereby claim:

  • I am marshallmick007 on github.
  • I am marshall (https://keybase.io/marshall) on keybase.
  • I have a public key ASA17PBT_cYdA7OfE1ysoU5JzIFSqSDPu6a7i5KLMIoidwo

To claim this, I am signing this object:

@marshallmick007
marshallmick007 / 1p2rp.rb
Created September 2, 2014 03:51
Converts a 1Password URL export to a RequestPolicy import file
#!/usr/bin/env ruby
require 'optparse'
require 'uri'
options = {}
opt_parser = OptionParser.new do |opt|
opt.banner = "1Password to RequestPolicy Converter"
opt.on('-i', '--in INPUT', "1password export of URLs") do |input|
@marshallmick007
marshallmick007 / rbenv-install-system-wide.sh
Last active June 20, 2017 22:33 — forked from jesteracer/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu 10.04 LTS.
#!/bin/bash
# Update, upgrade and install development tools:
# apt-get update
# apt-get -y upgrade
# apt-get -y install build-essential
# apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv

Merging two hashes

defaults = { :test => 1, :original => 'thing' }
overrides = { test: '42', :some_new_thing => 'cats' }
defaults.merge(overrides)
#{
#              :test => "42",
#          :original => "thing",
# :some_new_thing => "cats"

LIKE

model.where(Sequel.like(:column, "%#{term}%"))

UPDATE

model.where(:column => value).update(:enabled => false)

Install Packages a batch at a time on Arch Linux

sudo pacman -S `pacoutdated |  cut -d ' ' -f 1 | head -n 10 | tr '\n' ' '`

Install all libs

 sudo pacman -S `pacoutdated | grep "^lib" | cut -d ' ' -f 1 | tr '\n' ' '`

Quickstart

bundle gem yourgemname
cd yourgemname
bundle install
gem build ./yourgemname.gemspec

Referencing local gems