Skip to content

Instantly share code, notes, and snippets.

View protolif's full-sized avatar

James Dunn protolif

  • Protolif Consulting LLC
  • Indianapolis, IN
View GitHub Profile
@protolif
protolif / _pic.html.haml
Created February 27, 2012 17:33
Uploading user avatars to S3
%section.settings-picture
%h2 Profile Picture
.picture-holder= get_avatar user
.picture-upload
%h3 Upload a new picture
= f.file_field :avatar
.button Choose a file to upload
.clearfix
.tip To avoid cropping, we recommend making your image 100x100 pixels. We only accept JPG, GIF, and PNG files.
@protolif
protolif / droidemo_activity.rb
Created March 16, 2012 23:53
NoMethodError: undefined method `width' for nil:NilClass
require 'ruboto/activity'
require 'ruboto/widget'
require 'ruboto/util/toast'
ruboto_import_widgets :Button, :TextView, :RelativeLayout
$activity.start_ruboto_activity "$sample_activity" do
setTitle 'Droidemo: A Ruboto Experiment'
def on_create(bundle)
@protolif
protolif / fb_likes.json
Created March 29, 2012 17:41
An example of a person's Facebook likes.
{
"data": [
{
"name": "The Terminator",
"category": "Movie",
"id": "181221288646788",
"created_time": "2012-03-27T14:08:35+0000"
},
{
"name": "why the lucky stiff",
Morgan:scribblr proto$ which ruby
/usr/local/bin/ruby
Morgan:scribblr proto$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.2.0]
Morgan:scribblr proto$ bin/rake test
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': /usr/local/src/scribblr/app/controllers/signature_controller.rb:3: syntax error, unexpected '\n', expecting tASSOC (SyntaxError)
/usr/local/src/scribblr/app/controllers/signature_controller.rb:45: syntax error, unexpected keyword_do_block, expecting keyword_end
company.users.each do |user|
^
/usr/local/src/scribblr/app/controllers/signature_controller.rb:53: syntax error, unexpected keyword_end, expecting $end
@protolif
protolif / picard-facepalm-ascii.txt
Created May 22, 2012 17:47
Captain Picard Facepalm ASCII
............................................________
....................................,.-'"...................``~.,
.............................,.-"..................................."-.,
.........................,/...............................................":,
.....................,?......................................................,
.................../...........................................................,}
................./......................................................,:`^`..}
.............../...................................................,:"........./
..............?.....__.........................................:`.........../
............./__.(....."~-,_..............................,:`........../
@protolif
protolif / jewel_thief.rb
Created October 24, 2012 11:35
Trying to figure out the path to the images directory
require "jewel_thief/version"
require "rubygems"
require "rubygame"
require "jewel_thief/game"
require "jewel_thief/player"
module JewelThief
Game.new
end
@protolif
protolif / Nuking-hard-drives-the-UNIX-way.sh
Created August 1, 2013 07:01
This shell script will fill your hard drive with random bits, and then zeros. It will do this seven times. It works on UNIX, Linux, and Mac. Make sure to change /dev/sda1 to your desired drive. For the extra paranoid, run truecrypt afterwards and burn the password. Cheers!
#!/bin/bash
echo "Beginning wipe"
for i in {1..7}
do
echo "Starting pass $i..."
dd if=/dev/urandom of=/sda1 bs=1M
dd if=/dev/zero of=/sda1 bs=1M
echo "Pass $i complete."
done
echo "Wipe complete."
@protolif
protolif / userContent.css
Last active April 21, 2016 05:25
Portal skin for Firefox
/*
The MIT License (MIT)
Portal Lite Skin for Firefox v1.2
Copyright (c) 2015 - 2016 James Dunn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@protolif
protolif / autorun.bat
Created August 26, 2015 18:35
Make Windows XP command prompt mimic a *NIX shell
@echo off
REM INSTALL: Add the full path string of this file via regedit to:
REM \HKCU\Software\Microsoft\Command Processor\AutoRun
REM Set up aliases to mimic BASH/*NIX environment
doskey ls=dir /X /Q /TW /OG /P $*
doskey ll=dir $*
doskey cat=type $*
doskey ..=cd..
doskey grep=find "$1" $2
doskey mv=ren $*
@protolif
protolif / portalSkin.meta.js
Last active March 12, 2017 10:17
Portal Skin
// ==UserScript==
// @name Portal Skin
// @description Minimalist theme for Netfor SMP
// @version 1.2.1
// @author James Dunn
// @namespace jdunn.netfor.com
// @grant none
// @include https://intranet.netfor.net/*
// @include http://intranet.netfor.net/*
// @updateURL https://gist.githubusercontent.com/protolif/0f9bd5daf64307b7696647563d554e46/raw/portalSkin.meta.js