Skip to content

Instantly share code, notes, and snippets.

View jonmagic's full-sized avatar

Jonathan Hoyt jonmagic

View GitHub Profile
/* utilities.js */
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
require 'feed_tools'
require 'rest_client'
require 'json'
# Fill these in. See disqus-sinatra-importer for details on what they do
# if they're not obvious
user_api_key = 'disqus_api_key_goes_here'
forum_shortname = 'your_disqus_shortname'
current_blog_rss = 'url_to_your_site_feed'
<style>
body {
margin:0;
padding:0;
background-color:#f0f0f0;
background-image:url(images/Untitled-1.jpg);
}
div#container {
width:747px;
margin:10px auto;
# cat .profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
export PATH=/opt/local/bin:/opt/local/sbin:/Library/PostgreSQL/8.3/bin:$PATH
export MANPATH=/opt/local/share/man:$MANPATH
export CLICOLOR=1
export TERM=xterm-color
# use yellow for directories
export LSCOLORS=dxfxcxdxbxegedabagacad
<form enctype='multipart/form-data' action='process.php' method='post'>
<table>
<tr>
<td><label>Name</label></td>
<td><input name="YourName" /></td>
</tr>
<tr>
<td><label>Name</label></td>
<td><input name="YourPhoneNumber" /></td>
</tr>
#!/usr/local/bin/ruby
require 'ftools'
class String
def has(word)
self =~ /#{word}/ ? true : false
end
def suffix(n)
return self if n == 1
case self
#! /usr/bin/python
import traceback
# tb = file('tb.txt', 'w')
# try:
import os, string, time, datetime, sys
def mount_disk(disk):
command = 'sudo mount %s /media/disk1' % (disk)
os.popen(command)
I'm cloning a hidden row, but I need to remove the number from every id/name attr and replace it with a unique number, like 'new Date().getTime()' would work as the new number...
I found this jquery replace attribute function, but can't get it to work:
jQuery.fn.replaceAttr = function(aName, rxString, repString) {
return this.attr(
aName,
function() { return jQuery(this).attr(aName).replace(rxString, repString); }
);
};
class LastDayNextDay
def self.last(day)
days = {
"monday" => 1,
"tuesday" => 2,
"wednesday" => 3,
"thursday" => 4,
"friday" => 5,
"saturday" => 6,
puts "Job Starting!"
$bootstrap = File.open('import_clients_from_qb.rb', 'w')
$bootstrap << File.read('db/utilities/suite_qb_bootstrap/bootstrap_bootstrap.rb')
$bootstrap << "puts \"Bootstrap Begin!\"\n"
class Addresser
def self.parse(qb_address_block)
return '' unless qb_address_block
hit_numeric = false
keep_lines = []