Skip to content

Instantly share code, notes, and snippets.

View akatz's full-sized avatar

Avrohom Katz akatz

  • ShopKeep POS
  • Brooklyn, NY
View GitHub Profile
tar(bsdtar): manipulate archive files
First option must be a mode specifier:
-c Create -r Add/Replace -t List -u Update -x Extract
Common Options:
-b # Use # 512-byte records per I/O block
-f <filename> Location of archive
-v Verbose
-w Interactive
Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ]
<file>, <dir> add these items to archive
@akatz
akatz / gist:4543027
Last active December 11, 2015 04:09
Guardfile
guard 'rspec', :cli => "--color --format nested", :notification => true do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
function instance_role {
grep instance_role /etc/chef/dna.json |awk -F\" '{print $4}'
}
function instance_id {
grep this /etc/chef/dna.json |awk -F\" '{print $4}'
}
function public_hostname {
ohai |grep public_hostname | awk -F\" '{print $4}'
}
function instance_name {
@akatz
akatz / prefill.js
Created February 2, 2012 19:17 — forked from jamesarosen/prefill.js
Pre-fill custom fields in Zendesk
jQuery(function($) {
var customFieldParam = /^ticket\[fields\]\[(\d+)\]$/,
urlParams = $.queryParameters(),
k, match, fieldID;
// for each URL parameter:
for (k in urlParams) {
if (urlParams.hasOwnProperty(k)) {
// check whether it's a Zendesk custom field
➜ rubinius git:(master) bin/mspec spec/ruby/core/proc
rubinius 2.0.0dev (1.8.7 c8a4b1ee yyyy-mm-dd JI) [x86_64-apple-darwin11.1.0]
..............................................................F......
1)
Proc.new with an associated block called on a subclass of Proc using a reified block parameter returns an instance of the subclass FAILED
Expected Proc
to equal #<Class:0x1d64>
/expectations.rb:15
# JRUBY-5026
describe "using a reified block parameter" do
it "returns an instance of the subclass" do
cls = Class.new do
def self.subclass=(subclass)
@subclass = subclass
end
def self.foo(&block)
@subclass.new(&block)
end
rubinius 2.0.0dev (1.8.7 c8a4b1ee yyyy-mm-dd JI) [x86_64-apple-darwin11.1.0]
Listing specs tagged with 'fails'
Actor.link sends an exit message to linked Actors
Actor#notify_exited kills actors not trapping exits
Actor#notify_exited delivers a message to an actor trapping exits
Actor.spawn creates functioning actors
VMActor::Container#spawn_actor creates Actors on remote VMs
The -x command line option runs code after the first /#!.*ruby.*/-ish line in target file
if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new("1.9")
s.add_dependency "SystemTimer"
end
@akatz
akatz / comment_permalink.js
Created June 8, 2011 18:31 — forked from jakeisonline/comment_permalink.js
Adds a permalink to all Zendesk comments, and scrolls to them when linked to
if Gem::VERSION >= "1.3.6"
module Rails
class GemDependency
def requirement
r = super
(r == Gem::Requirement.default) ? nil : r
end
end
end
end