Skip to content

Instantly share code, notes, and snippets.

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@zbrdge
zbrdge / mDNSResponder.plist.patch
Created April 12, 2014 12:18
OS X Chroot mDNSResponder
--- /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist 2014-04-12 05:15:39.000000000 -0700
+++ /tmp/com.apple.mDNSResponder.plist.new 2014-04-12 05:15:11.000000000 -0700
@@ -26,6 +26,7 @@
<key>Sockets</key>
<dict>
<key>Listeners</key>
+ <array>
<dict>
<key>SockFamily</key>
<string>Unix</string>
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 2, 2024 12:33
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@billagee
billagee / print_root_element_name.rb
Created April 14, 2012 11:26
Pure Ruby snippet that prints the name of the root (Desktop) MS UI Automation element using IUIAutomation::GetRootElement and wprintf
# Find me at https://gist.github.com/2383726
#
# This script shows how to use wprintf() and a few functions from the
# MS UI Automation COM interface (IUIAutomation) to print the name
# of the desktop's IUIAutomationElement on a Windows machine.
# For more information see the MS docs on:
#
# IUIAutomation::GetRootElement
# IUIAutomationElement::get_CurrentName
#
@dnagir
dnagir / import.rb
Created February 8, 2012 04:41 — forked from baldowl/import.rb
Import a blogger archive to jekyll (octopress version, allows quotes in titles)
require 'rubygems'
require 'nokogiri'
require 'fileutils'
require 'date'
require 'uri'
# usage: ruby import.rb my-blog.xml
# my-blog.xml is a file from Settings -> Basic -> Export in blogger.
data = File.read ARGV[0]
@chumpy
chumpy / yaml_compare.rb
Created January 29, 2012 00:20
compare two yaml files in ruby
#require 'active_support/core_ext'
class YamlCompare
def self.compare_keys first_file_info, second_file_info, results_location
first_file = Hash.new
second_file = Hash.new
deltas_file = Hash.new
File.open( first_file_info[:file_location] ) { |yf| first_file = YAML.load( yf ) }
File.open( second_file_info[:file_location] ) { |yf| second_file = YAML.load( yf ) }
first_file[first_file_info[:root]].each_pair do |k,v|