Skip to content

Instantly share code, notes, and snippets.

View stuffmc's full-sized avatar

StuFF mc stuffmc

View GitHub Profile
git init
git remote add foo git://github.com/280north/cappuccino.git
git fetch foo
git checkout foo/master README
/* -----------------------------------------------------
Mailplane Hide Gmail Ads CSS
----------------------------------------------------- */
/* Hide the ads */
.oM,
.u7,
.V3vJRb,
.yxEQwb,
.mv,
@stuffmc
stuffmc / gist:319684
Created March 2, 2010 17:06
PayPal Express
::PAYPAL_OPTIONS = {
:user => "xxx",
:pwd => "xxx",
:signature => "xxx",
:version => '57.0',
}
::PAYPAL_API_URL = 'https://api-3t.paypal.com/nvp'
::PAYPAL_TOKEN_URL = 'https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token='
def paypal_express
class XMPPD
def initialize(username, password)
begin
@mainthread = Thread.current
login(username, password)
listen_for_presence_notifications
send_initial_presence
rescue Exception => e
puts "*** ERROR (initialize): #{e}"
@stuffmc
stuffmc / gist:372326
Created April 20, 2010 11:32
I was looking for a way to have the list of countries sorted alphabetically on the name...
We couldn’t find that file to show.
// First get the list of ISO Codes
NSArray *countries = [NSLocale ISOCountryCodes];
// Then create an empty array for the list of country with both code and name
NSMutableArray *namedCountries = [NSMutableArray arrayWithCapacity:[countries count]];
NSUInteger countryIndex = 0;
// Loop over the codes and have their localized names
for (NSString *code in countries) {
NSString *name = [[NSLocale currentLocale] displayNameForKey:NSLocaleCountryCode value:code];
@stuffmc
stuffmc / sudo port install avahi
Created November 11, 2010 15:30
Totally insane install of avahi.org via darwinports....
➥ sudo port install avahi
Password:
---> Computing dependencies for avahi
---> Dependencies to be installed: dbus-python26 dbus autoconf help2man gettext expat libiconv gperf ncurses ncursesw p5-locale-gettext perl5 perl5.8 m4 automake libtool pkgconfig dbus-glib glib2 zlib gtk-doc docbook-xml docbook-xml-4.1.2 xmlcatmgr docbook-xml-4.2 docbook-xml-4.3 docbook-xml-4.4 docbook-xml-4.5 docbook-xml-5.0 docbook-xsl gnome-doc-utils intltool gnome-common p5-getopt-long p5-pathtools p5-scalar-list-utils p5-xml-parser iso-codes libxslt libxml2 py26-libxml2 python26 bzip2 db46 gdbm openssl readline sqlite3 rarian getopt py26-gobject libffi libdaemon libglade2 fontconfig freetype gtk2 atk gdk-pixbuf2 jasper jpeg libpng tiff pango Xft2 xrender xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-xproto xorg-libXdmcp xorg-libxcb xorg-libpthread-stubs xorg-xcb-proto xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-renderproto cairo libpixman shared-mime-info
Using htmlentities (4.2.2)
Installing linecache (0.43) with native extensions ~/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
~/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
group :development do
if RUBY_VERSION =~ /1.9/
gem "ruby-debug19"
else
gem "ruby-debug"
end
end
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.radio { text-align: center; height:125px; float:left; overflow:hidden; }
/* Why o why does this overflow gives me a non transparent background?
If you remove the overflow then you'll see it's not as nice */
.radio.show { -webkit-animation-name: slide; -webkit-animation-duration: 1s; width: 70px; }
@-webkit-keyframes slide { from { width: 0px;} to { width: 70px; } }
.logo { float:left; width:90px; height:90px; background:no-repeat; }