Skip to content

Instantly share code, notes, and snippets.

(function($){
$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"
})(jQuery);
(function($){
$.fn.reset=function(){
return this.each(function(){
if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){
this.reset()
}

This is a tutorial for beginning users of the macintosh terminal. Please feel free to fork this and edit/augment it. Good changes will get merged in.

<script type="text/javascript">
var appVer = navigator.appVersion;
var searchVersion = /\s(\d)_\d/;
var searchDevice = /\s[(](\w+\s?\w*)[;]\s/;
var isIPhone = false;
var isIPad = false;
if (searchVersion.exec(appVer) && searchDevice.exec(appVer)){
var deviceVersion = searchVersion.exec(appVer)[1];
if ("iPhone" == searchDevice.exec(appVer)[1]){ isIPhone = deviceVersion; }
if ("iPhone Simulator" == searchDevice.exec(appVer)[1]){ isIPhone = deviceVersion; }
alias reload='. ~/.bashrc'
alias ea="$EDITOR ~/bin/dotfiles/bash/aliases && reload"
alias ee="$EDITOR ~/bin/dotfiles/bash/env && reload"
alias eh="$EDITOR ~/bin/dotfiles/bash/heroku && reload"
# Processes
alias tu='top -o cpu'
alias tm='top -o vsize'
# Projects
This is a collection of JS to help get jQuery integrated into a Rails project, specifically intended to be used with the jQuery.form plugin.
/*
Jquery and Rails powered default application.js
Easy Ajax replacement for remote_functions and ajax_form based on class name
All actions will reply to the .js format
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link
respond_to do |format|
format.html
format.js {render :layout => false}
end
*/
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
/* `HTML5 Reset
----------------------------------------------------------------------------------------------------*/
a,
abbr,
address,
article,
aside,
audio,
b,

Snippets

This repo is just a collection of snippets that I've wanted to hang on to. Not unlike gists, but more for my own not-keeping purposes. Hopefully someone else will find these as useful as I do. If you have any questions, you can email me at [email protected]. Thanks!

-Mike

WARNING

As these are nothing more than snippets, I really make no promise of extensive documentation. Where I can, I'll make notes, but I can't promise that they'll mean much to anyone other than me. You're more than welcome to ask me to clarify, but please keep in mind that initial caveat.

// Run via OS X Terminal.app to block junk tweets in Tweetie.
// Info: http://atebits.posterous.com/test-filtering-in-tweetie-for-mac
defaults write com.atebits.tweetie-mac filterTerms -array "@gowalla" "http://gowal.la" "@foursquare" "http://4sq.com"