Skip to content

Instantly share code, notes, and snippets.

View Joe8Bit's full-sized avatar
👋
@banked is hiring! Reach out!

Joe Pettersson Joe8Bit

👋
@banked is hiring! Reach out!
View GitHub Profile
@Joe8Bit
Joe8Bit / hack.sh
Created March 31, 2012 10:26 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@Joe8Bit
Joe8Bit / jQuery Github Widget example code
Created June 9, 2012 20:16
Github jQuery plugin usage
<script src="jquery.min.js"></script>
<script src="jquery.github.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#some-element").github({
user: "joepettersson"
});
});
@Joe8Bit
Joe8Bit / Better version
Created June 10, 2012 13:20 — forked from gabehollombe/Better version
Capybara: a better way to check if text is visible
#A better 'I should not see' for Capybara that lets jQuery determine visibility of the text you're looking for.
Then /^"([^\"]*)" should not be visible$/ do |text|
finder_script = %{
function is_text_visible_on_page(text) {
var match = false;
$('*:visible')
.contents()
.filter(function() {
//collect text nodes
@Joe8Bit
Joe8Bit / gist:2909925
Created June 11, 2012 12:45
Pretty Gist: Simple
<head>
...
<link rel="stylesheet" href="prettygist.min.css">
<script src="jquery.min.js"></script>
<script src="jquery.prettygist.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".gist").prettyGist();
});
</script>
@Joe8Bit
Joe8Bit / gist:2909953
Created June 11, 2012 12:53
Pretty Gist: Slim Header
<head>
...
<link rel="stylesheet" href="prettygist.min.css">
<script src="jquery.min.js"></script>
<script src="jquery.prettygist.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".gist").prettyGist({
extendedHeader: false
});
@Joe8Bit
Joe8Bit / gist:2909965
Created June 11, 2012 12:55
Pretty Gist: No Footer
<head>
...
<link rel="stylesheet" href="prettygist.min.css">
<script src="jquery.min.js"></script>
<script src="jquery.prettygist.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".gist").prettyGist({
extendedHeader: false,
showFooter: false
@Joe8Bit
Joe8Bit / server.sh
Last active October 6, 2015 10:58
Fire up a simple server from the command line
function server () {
local port="${1:-8000}"
open "http://localhost:${port}/"
python -m SimpleHTTPServer "$port"
}
@Joe8Bit
Joe8Bit / rails_cloc.sh
Created July 13, 2012 15:31 — forked from nlively/rails_cloc.sh
Count lines of code in a rails project
#!/bin/bash
find . \( -iname '*.rb' -o -iname '*.css' -o -iname '*.js' -o -iname '*.erb' -o -iname '*.html' -o -iname '*.scss' \) -exec wc -l {} + | sort -n
@Joe8Bit
Joe8Bit / async_loader.js
Created July 16, 2012 20:32 — forked from noonien/async_loader.js
Asynchronous Javascript/CSS loader.
AL = function(type, url, callback) {
var el, doc = document;
switch(type) {
case 'js':
el = doc.createElement('script');
el.src = url;
el.type = 'text/javascript';
el.async = true;
break;
@Joe8Bit
Joe8Bit / Gemfile
Created September 13, 2012 21:44
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin