Skip to content

Instantly share code, notes, and snippets.

View searls's full-sized avatar
💚

Justin Searls searls

💚
View GitHub Profile
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 10.0.1.1 UGSc 5 0 en0
10.0.1/24 link#4 UCS 3 0 en0
10.0.1.1 b8:c7:5d:ca:2d:a2 UHLWIi 15 24 en0 1198
10.0.1.19 127.0.0.1 UHS 0 0 lo0
10.0.1.255 ff:ff:ff:ff:ff:ff UHLWbI 0 6 en0
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 7 11230 lo0
169.254 link#4 UCS 0 0 en0
# http://stackoverflow.com/questions/588004/is-javascripts-math-broken
beforeEach ->
this.addMatchers
toPrettyMuchEqual: (number) ->
return Math.abs(this.actual - number) < 0.000001
(function(){
window.Sweden = function(){
var self = {};
self.giveMeACookie = function(){
return makeACookie();
};
var makeACookie = function(){
return "kaka";
};
@searls
searls / find-jars.sh
Created September 22, 2011 00:55
Find all the classes in all the jars in a directory and spit out the listing in /tmp/jars.txt
#awesome @magnustahre is awesome.
find . -name "*.jar" | while read jar ; do echo $jar ; unzip -l $jar ; done > /tmp/jars.txt
@searls
searls / pygments.sh
Created September 27, 2011 12:36
installing pygments
#docco requires the latest commits to pigments, but building it was not obvious to me. this worked:
sudo ./setup.py easy_install --local-snapshots-ok .
@searls
searls / flank.css
Created October 1, 2011 05:08
On my blog, I wanted large-screened devices to have the content flanked by a perma-link (on the left) and a publication date (on the right), but on iPhone I wanted to pull those into the main flow to prevent zoom-out
/* Flanking visual elements */
.permalink {
font-size: 35px;
position: absolute;
display: inline-block;
left: -45px;
top: -2px;
vertical-align: middle;
@searls
searls / cucumber.yml
Created October 5, 2011 17:31
example cucumber.yml
<%
locations = "-r features/support -r features/step_definitions"
regression_opts = "#{locations} --tags ~@wip --tags ~@future"
wip_opts = "#{locations} --tags @wip --wip features"
ci_opts = "--format pretty --format html"
%>
default: <%= regression_opts %>
wip: <%= wip_opts %>
ci: <%= regression_opts %> <%= ci_opts %> --out=target/reports/regression_report.html
ci_wip: <%= wip_opts %> <%= ci_opts %> --out=target/reports/wip_report.html
@searls
searls / jasmine-jquery-lite.js
Created October 9, 2011 14:16
Just replaced 99% of what I use jasmine-jquery for in 10 lines.
beforeEach(function() {
this.addMatchers({
toIs: function(selector) {
return this.actual.is(selector);
},
toHas: function(selector) {
return this.actual.find(selector).length > 0;
}
});
});
describe("clicking a show description link", function() {
beforeEach(function(){
loadFixtures("two_index_trip.html");
//I recommend against writing assertions in the 'arrange' phase
//because if you're test-driving, feedback from the system is all you need to validate your arrangement.
//expect($('#description_trip_2')).toBeHidden();
$("#detail_link_trip_2").click();
});
it("shows the trip description", function() {
var Book = function(){
var self = {};
self.open = function(){
//public book openin'!
}
var turnPage = function(){
//private page turnin'!
};