Skip to content

Instantly share code, notes, and snippets.

View curiositycasualty's full-sized avatar
🗺️
Internet Explorer

Isa Farnik curiositycasualty

🗺️
Internet Explorer
View GitHub Profile
@curiositycasualty
curiositycasualty / 0_reuse_code.js
Created May 15, 2014 19:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@curiositycasualty
curiositycasualty / client.rb
Created August 5, 2014 21:52
Custom Generic Event Subscriber
log_location STDOUT
chef_server_url "https://isa-ec11-0-2-allitnil.opscode.us/organizations/allitnil"
validation_client_name "allitnil-validator"
# Using default node name (fqdn)
# can also be started using chef_handler more info at http://docs.getchef.com/handlers.html#run-from-client-rb
require '/etc/chef/foo'
event_handlers << YaySubscriber.new

YELLY!!!!! THE YELLINGIST FORMATTER EVER!!!!!

Yelly likes to yell. To make the magic happen for simple cases just invoke him ala:

bundle exec rspec --require=yelly_the_yellingist_formatter.rb --format=YellyTheYellingistFormatter spec/models/your_file_here_spec.rb

In closing, >:O

Updated to Rspec 3.0's formatter interface.

@curiositycasualty
curiositycasualty / .zshrc
Last active August 29, 2015 14:07
iTerm/OSA functions
# use applescript to activate an application by name
function activate() {
app=$1;
echo "tell application \"$app\" to activate" | osascript;
}
# use applescript open a new iTerm (horizontal) pane with a given command to run as an argument
function new_hpane() {
cmd=$1;
activate "iTerm";
echo "tell application \"System Events\" to tell process \"iTerm\" to keystroke \"d\" using {command down, shift down}\ntell application \"System Events\" to tell process \"iTerm\" to keystroke \"$cmd\"\ntell application \"System Events\" to tell process \"iTerm\" to key code 52" | osascript;
#
# platform()
#
# Determine and return the current
# platform. Optionally return only the
# OS name with -o/--OS, or only the
# version with -v/--version.
#
function platform_ingestor() {
local argv="$@";
aaaaa
bbbbb
vvvvvvvv
V!? wth ಠ_ಠ, otherwise known as the “look of disapproval,”
@curiositycasualty
curiositycasualty / install_xcodes.bash
Created March 19, 2016 18:35
Install Xcode SDK major releases from Xcode 6.1.1 - 7.2.1 into a host's Xcode.app
#!/usr/bin/env bash
PREFIX='./xcodes'
DMGs=(xcode_6.1.1.dmg
Xcode_6.2.dmg
Xcode_6.3.2.dmg
Xcode_6.4.dmg
Xcode_7.0.1.dmg
Xcode_7.1.1.dmg
Xcode_7.2.1.dmg)
Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a=set('yay')
>>> a.add('yay')
>>> a
set(['y', 'a', 'yay'])
>>> a.add('yay')
>>> a
set(['y', 'a', 'yay'])
@curiositycasualty
curiositycasualty / parse_pbzx2.py
Created February 5, 2017 09:28 — forked from pudquick/parse_pbzx2.py
A pbzx stream decoder for the format found within Yosemite package payloads.
# v2 pbzx stream handler
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5
#
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
import struct, sys

Keybase proof

I hereby claim:

  • I am curiositycasualty on github.
  • I am wafflewiz (https://keybase.io/wafflewiz) on keybase.
  • I have a public key whose fingerprint is B351 DBA7 9AEC 8250 E369 4125 1031 5374 A7D2 37FD

To claim this, I am signing this object: