Skip to content

Instantly share code, notes, and snippets.

View dljsjr's full-sized avatar

Douglas Stephen dljsjr

View GitHub Profile
@dljsjr
dljsjr / wxmac.txt
Created September 29, 2013 21:34
brew install wxmac -v > wxmac.txt 2>&1
This file has been truncated, but you can view the full file.
==> Downloading http://downloads.sourceforge.net/project/wxpython/wxPython/2.9.5.0/wxPython-src-2.9.5.0.tar.bz2
Already downloaded: /Library/Caches/Homebrew/wxmac-2.9.5.0.tar.bz2
tar xf /Library/Caches/Homebrew/wxmac-2.9.5.0.tar.bz2
==> ./configure --disable-debug --prefix=/usr/local/Cellar/wxmac/2.9.5.0 --enable-shared --enable-unicode --enable-std_string --enable-display --with-opengl --with-osx_cocoa --with-libjpeg --with-libtiff --with-libpng --with-zlib --enable-dnd --enable-clipboard --enable-webkit --enable-svg --with-expat --with-macosx-version-min=10.8 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk --enable-universal_binary=i386,x86_64 --disable-precomp-headers --enable-monolithic
./configure --disable-debug --prefix=/usr/local/Cellar/wxmac/2.9.5.0 --enable-shared --enable-unicode --enable-std_string --enable-display --with-opengl --with-osx_cocoa --with-libjpeg --with-libtiff --with-libpng --with-zlib --enable-dnd --enable-clipboa
@dljsjr
dljsjr / .vimrc
Last active December 11, 2015 07:19
.vimrc entry that transforms an opening curly brace on a new line in to matched pairs of curly braces, opening brace on a new line, and puts the cursor in between them with a tab inserted. I'm a strong believer in the "opening curly brace on a new line" philosophy.
" So, for example, typing something like
"
" testfn()<carriage return>{
"
" would yield:
"
" testfn()
" {
" <cursor, in insert mode>
" }
@dljsjr
dljsjr / gist:3861693
Created October 9, 2012 21:54
Ugly date-time AppleScript
set theDate to current date
set dateString to (theDate's year as string) & "-" & (theDate's month as integer as string) & "-" & (theDate's day as string)
set timeString to time string of theDate
set hourColonIndex to offset of ":" in timeString
set theHour to characters 1 through (hourColonIndex - 1) of timeString as string
@dljsjr
dljsjr / node_tools.rb
Created October 5, 2012 01:52
The NodeTools Stuff
class NodeTools
def self.write_requires(node)
raise TypeError unless node.is_a? File
node.puts "require \"rubygems\""
node.puts "require \"bundler/setup\""
node.puts
node.puts "require \"sinatra/base\""
end
@dljsjr
dljsjr / brain.rb
Created October 5, 2012 01:51
The Sinatra Brain
class Brain < Sinatra::Base
set :public_folder, File.dirname(__FILE__) + '/static_files'
# Utility Defs
# This is what I use to serve up the static page that handles the AJAX front-end.
# It allows me to serve up a pretty URL without the .html trailer that would
# normally result from using Sinatra's built-in public folder. It skips the first
# character of the route_name because this is the / character from request.path_info
#
@dljsjr
dljsjr / gist:3591788
Created September 2, 2012 00:02
A quick AppleScript for use with TextExpander to pull the title and URL of the frontmost Safari tab out
-- I use this snippet with Octopress to make new linklog posts.
-- I've tweaked the new_post rake task to allow me to fill in
-- the external-url: property by taking in a second argument:
-- rake new_post["Blog Title","http://some.url.com/"]
-- If the 2nd argument is the empty string, then I omit
-- that property in the yaml front matter.
-- I should note that I haven't updated my Octopress engine in a long time,
-- and when I set up the blog, link posts weren't built in. So
-- there may be a proper rake task for this now, since I think
@dljsjr
dljsjr / FrameExample.java
Created June 23, 2011 22:44
An example of something that doesn't work on OS X for some reason (for the purposes of an SO link)
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent;