Skip to content

Instantly share code, notes, and snippets.

Bradford Cottel likethesky

Block or report user

Report or block likethesky

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
likethesky / gist:3342081
Created Aug 13, 2012
Determining retina display manufacturer on rMBP
View gist:3342081
ioreg -lw0 | grep \"EDID\" | sed "/[^<]*</s///" | xxd -p -r | strings -6
Ripley: (want manufacturer: 'SEC') also:
# If it outputs: LPxxx... then you have an LG, if: LSNxx... then you have a Samsung
# See: [DigiLloyd Burn-in follow-up]( -and- [DigiLloyd MBPr Screen Burn-in] (
# And (Apple Support thread):
# Serial # links (to determine week of manufacture): -and-
likethesky / gist:3559639
Created Aug 31, 2012
Rebuild MBR partition on USB key
View gist:3559639
likethesky / gist:3559671
Last active Oct 9, 2015
find: Usage of Unix find command
View gist:3559671
find . -name '*lookingfor*' -print
find /path/you/want/to/start/in -name '*.rb' -print
# On OS X (searched indexed spotlight files, both user & system):
likethesky / gist:3559687
Created Aug 31, 2012
Extract a single file from .tar -- give it a name interactively
View gist:3559687
cpio -i -r *strict.lua < lua-5.1.4.tar.gz
likethesky / gist:3559735
Created Aug 31, 2012
Fix Ubuntu from command-line / recovery mode
View gist:3559735

So choose Recovery Mode, then login/exit to the command line, then:

mount -n -o remount,rw /

Above makes your hard drive read/write, which you'll need, in order to do the next step

sudo nano /etc/X11/xorg.conf

Use nano to edit your xorg.conf to fix it, ideally.

likethesky / gist:3829964
Created Oct 3, 2012
Setup fresh Sublime Text 2 on Ubuntu / Linux
View gist:3829964

Ubuntu / Linux install of Sublime Text

This will install and setup sublime (in /opt) and make it available via the 's' link (kept in /usr/local/bin)

Just type s on command line to open Sublime Text from then on!

First, (from a browser in your target Linux OS) go here: (<-- click this link) and THEN right-click the <Download for Linux> button, and choose: Copy Link Location ... so you have the latest/greatest for your Linux OS.

Now in a terminal (ctrl-alt T, in Ubuntu), execute the following:

cd /opt

likethesky / gist:3836758
Created Oct 4, 2012
NetBeans 7.2 sample JavaFX app directory
View gist:3836758
brad@brad-macmini-ubuntu12-x64:~/NetBeansProjects/JavaFXApplication1$ ls -lAHtrR
total 24
drwxrwxr-x 4 brad brad 4096 Oct 4 09:15 nbproject
drwxrwxr-x 3 brad brad 4096 Oct 4 09:15 src
-rw-rw-r-- 1 brad brad 82 Oct 4 09:15
-rw-rw-r-- 1 brad brad 3474 Oct 4 09:17 build.xml
drwxrwxr-x 5 brad brad 4096 Oct 4 11:58 build
drwxrwxr-x 4 brad brad 4096 Oct 4 11:58 dist
likethesky / gist:3842609
Created Oct 5, 2012
Shutdown Ubuntu via terminal command
View gist:3842609

sudo shutdown -P now # completely shuts down and powers off machine (if hardware supports power off signal)

sudo shutdown now # shuts down, doesn't power off -- see for more details.

likethesky / index.html.haml
Created Nov 5, 2012
Cantango Demo -- goes in public/index.html of cantango_demo
View index.html.haml
%h1 Welcome to the CanTango Demo
%td= link_to("Home", root_path)
%td= link_to("Sign in", new_user_session_path)
%td= link_to("Sign up", new_user_registration_path)
%td= link_to("Sign out", destroy_user_session_path, :method => :delete)
%td= link_to("User forgot password", new_user_password_path)
%td= link_to("Admin home", admin_dashboard_path)
likethesky / gist:4262178
Created Dec 11, 2012
addressable gem dependency not bundled
View gist:4262178
My bundle aliases:
b = bundle
be = b exec
bi = b install --path vendor
bu = b update
bil = bi --local
binit = bi && b package --all && echo "vendor/ruby" >> .gitignore
# Note: my comments are in [#square brackets like this]
You can’t perform that action at this time.