Skip to content

Instantly share code, notes, and snippets.

View tricon's full-sized avatar

David Aaron Fendley tricon

View GitHub Profile
@priyadarshan
priyadarshan / lisp-idioms.md
Created May 10, 2015 18:52
Lisp Idioms (Gene Michael Stover)
@avdi
avdi / nullenum.rb
Created January 9, 2015 20:32
Behold, the null enumerator.
e = loop
e # => #<Enumerator: main:loop>
e.next # => nil
e.next # => nil
e.peek # => nil
e.size # => Infinity
e.rewind
e.next # => nil
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active March 20, 2025 20:23
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active February 20, 2025 09:37
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@makmanalp
makmanalp / sshtest-playbook.yml
Last active June 18, 2021 15:06
SSH agent forwarding tester for ansible / vagrant
---
- hosts: all
sudo: no
tasks:
- shell: echo "Client= [$SSH_CLIENT] Sock= [$SSH_AUTH_SOCK]"
register: myecho
- debug: msg="{{myecho.stdout}}"
- shell: ssh-add -l
register: myecho
- debug: msg="{{myecho.stdout}}"
@todc
todc / mac-setup.md
Last active September 25, 2021 09:21
Fresh Mac OS Setup

1. Run Software Update

Make sure everything is up to date.

Software Update

2. Install Xcode and its "Command Line Tools"

  1. Go to App Store and install Xcode.
  2. Open and accept the terms
(add-hook 'ruby-mode-hook
'(lambda ()
(define-key ruby-mode-map (kbd "C-c c") 'rinari-find-controller)
(define-key ruby-mode-map (kbd "C-c m") 'rinari-find-model)
(define-key ruby-mode-map (kbd "C-c v") 'rinari-find-view)
(define-key ruby-mode-map (kbd "C-c e") 'rinari-find-environment)
(define-key ruby-mode-map (kbd "C-c i") 'rinari-find-migration)
(define-key ruby-mode-map (kbd "C-c j") 'rinari-find-javascript)
(define-key ruby-mode-map (kbd "C-c n") 'rinari-find-configuration)
(define-key ruby-mode-map (kbd "C-c v") 'rinari-find-view)
@adamico
adamico / collection_check_boxes_input.rb
Last active January 17, 2025 21:21 — forked from mattclar/simple_form.rb
This fork adds a custom horizontal form wrapper and merges append/prepend in a 'group' wrapper
#app/inputs/collection_check_boxes_input.rb
class CollectionCheckBoxesInput < SimpleForm::Inputs::CollectionCheckBoxesInput
def item_wrapper_class
"checkbox-inline"
end
end
@maxim
maxim / rails_load_path_tips.md
Last active January 9, 2025 00:59
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@jtimberman
jtimberman / default_spec.rb
Created May 10, 2013 03:14
this is cookbooks/java/spec/default_spec.rb. Then install the chefspec gem and run rspec. (yay!)
require 'chefspec'
describe 'java::default' do
let (:chef_run) { ChefSpec::ChefRunner.new.converge('java::default') }
it 'should include the openjdk recipe by default' do
chef_run.should include_recipe 'java::openjdk'
end
context 'windows' do
let(:chef_run) do