Skip to content

Instantly share code, notes, and snippets.

View pjdavis's full-sized avatar

PJ Davis pjdavis

  • Chapel Hill, North Carolina
View GitHub Profile
@pjdavis
pjdavis / bonemanproject.txt
Created February 27, 2019 02:27
Boneman Project
Dim SessionState(127) As Integer
Dim y(127) As String
Dim h As Integer
Private Sub about_Click(Index As Integer)
frmAbout.Show
End Sub
Private Sub Clearlog_Click(Index As Integer)
### Keybase proof
I hereby claim:
* I am pjdavis on github.
* I am pjdavis (https://keybase.io/pjdavis) on keybase.
* I have a public key whose fingerprint is B82A 60F6 DFE1 6DD5 C8CF 6807 8C37 BC25 9FAC DBEE
To claim this, I am signing this object:
@pjdavis
pjdavis / run.sh
Created October 4, 2011 21:44
minecraft flying mod
#!/bin/bash
#current for modpack v 4.16 2011 apr 20
# move to the tmp directory
cd /tmp
#save the full path to the file
curl -C - http://dl.dropbox.com/u/19090066/minecraft/zombe\'s_modpack-v5.1_MC.beta.1.9.pre2.zip -o zombie.zip
ZIPFILE=`pwd`/zombie.zip
read ZIPFILE
#make a directory to hold the files from the zip file
@pjdavis
pjdavis / updatechromium.sh
Created June 29, 2011 03:24
Update Chromium
#!/bin/bash
if [ -e "/Applications/Chromium.app/Contents/Info.plist" ];then
chk=`echo "1"`
else
chk=`echo "0"`
fi
if [ "$chk" -eq "1" ];then
old=`/usr/libexec/PlistBuddy -c 'Print :SVNRevision' /Applications/Chromium.app/Contents/Info.plist`
else
old=`echo "0"`
@pjdavis
pjdavis / gist:978610
Created May 18, 2011 13:58
Bundler Exception
What version of bundler you are using
Bundler version 1.0.13
What version of Ruby you are using
ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-linux], MBARI 0x8770, Ruby Enterprise Edition 2010.02
Whether you are using RVM, and if so what version
no
Your Gemfile
require 'tempfile'
require 'base64'
require 'zlib'
def read(file, bytes, unpack)
return file.read(bytes).unpack(unpack).first
end
f = File.open(ARGV.first)
#Problem: I have a self referential join from Page<->Page through links. When page is updated,
# friendly_id runs reflect_on_all_associations to get the associations and see if they have
# friendly id's that need to be updated. When this runs, i get Stack Level Too Deep. I think
# it's because of how my self-referential join is set up, but i'm not sure how else to set
# it up.
create_table "revisions", :force => true do |t|
t.integer "page_id"
t.text "content"
@pjdavis
pjdavis / ruby_conf_vids.rb
Created December 2, 2008 14:17 — forked from seanstickle/ruby_conf_vids.rb
Ruby Hoedown 2008
#!/usr/bin/env ruby
require "rubygems"
require "hpricot"
require "open-uri"
url = "http://feeds.feedburner.com/RubyHoedown2008-Confreaks"
(Hpricot(open url)/:enclosure).map {|x| x.attributes["url"]}.uniq.each do |vid|
File.exist?(vid.split("/").last) ? next : `wget #{vid}`
@pjdavis
pjdavis / gist:16759
Created October 14, 2008 18:41 — forked from jm/gist:16719
require 'faker'
define_models do
model Site do
20.times do
# Fairly sure this isn't the right Faker syntax but oh well
stub :title => Faker::Company.name
end
end
end
@pjdavis
pjdavis / gist:15051
Created October 6, 2008 14:36
A little script I wrote to spam our relay mail server to see if it was doing what we wanted it to do.
class Email
@@blacklist = Array.new
@@reg = /\A([-a-z0-9]+[\w\.\-\+]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
def initialize(mailbox, host)
@host = host
@address = "#{mailbox}@#{host}"
end