Skip to content

Instantly share code, notes, and snippets.

View Sharpie's full-sized avatar

Charlie Sharpsteen Sharpie

View GitHub Profile
@RichMorin
RichMorin / x.out
Created May 15, 2012 19:28
YARD Registry Dumper
# file_path: "yard/.yardoc"
# options: {:types=>[:namespace, :method], :levels=>2}
# node_path: "YARD"
{
"@context": {
"type": "@type",
"y_ld": "http://sparqly.cfcl.com/y_ld/",
"yard": "http://sparqly.cfcl.com/yard/",
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@matsadler
matsadler / ruby-2.0.0-in-detail.md
Last active December 14, 2015 16:29
Detailed rundown of many of the new features in Ruby 2.0.0.

Ruby 2.0.0 in detail

Keyword arguments

def wrap(string, before: "<", after: ">")
  "#{before}#{string}#{after}" # no need to retrieve options from a hash
end

# optional
@kylog
kylog / gist:d98dfc7e709c0878ac93
Last active August 29, 2015 14:02
vcloud one liners
listvm() { curl --url http://vcloud.delivery.puppetlabs.net/vm 2> /dev/null | ruby -e 'require "json"; JSON.parse(STDIN.read).each { |vm| puts vm }' }
getvm() { curl -d --url http://vcloud.delivery.puppetlabs.net/vm/$1 2> /dev/null | ruby -e 'require "json"; resp = JSON.parse(STDIN.read); puts resp["'$1'"]["hostname"]'}
sshvm() { ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa-acceptance root@$1 "${@:2}" }
rmvm() { curl -X DELETE --url http://vcloud.delivery.puppetlabs.net/vm/$1 }
@Iristyle
Iristyle / encoding.md
Last active April 1, 2022 14:04
Encoding in Puppet

Basic encoding info

  • ASCII is 0 - 7F (128 total characters) - ASCII is a subset of UTF-8
  • UTF-8 - variable width 1 to 4 bytes
Numberof bytes Bits forcode point Firstcode point Lastcode point Byte 1 Byte 2 Byte 3 Byte 4
1 7 U+0000 U+007F 0xxxxxxx      
2 11 U+0080 U+07FF 110xxxxx 10xxxxxx    
3 16 U+0800 U+FFFF 1110xxxx 10xxxxxx 10xxxxxx