Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import json
import sys
import time
import uuid
def generate_log_str(command, full_command, time):
data = {
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
task :update_submodules do
App.log 'Git', 'Updating all our git submodules'
`cd .. && git submodule foreach git checkout master && cd -`
`cd .. && git submodule foreach git pull --rebase && cd -`
end
[alias]
st = status
ci = commit
co = checkout
dt = difftool
di = diff
dc = diff --cached
amend = commit --amend
aa = add --all
head = !git l -1
# Disable menu bar transparency
#defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Show remaining battery time; hide percentage
#defaults write com.apple.menuextra.battery ShowPercent -string "NO"
#defaults write com.apple.menuextra.battery ShowTime -string "YES"
# Always show scrollbars
#defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
string at 523601
pre each_char, length is
post each_char, length is 0
post reading string pos is 523603
string objects len is 0
string at 523603
pre each_char, length is
post each_char, length is 12
post reading string pos is 523618
string objects len is 12
@igorgue
igorgue / 001.py
Created April 29, 2012 01:20
Freqent Hack Weekend 001
# Write a small program that extracts all the links we have in this page
html_page = """<div id="navigation">
<ul>
<li><a href="http://freqent.com/locations">Locations</a></li>
<li><a href="http://freqent.com/business" target="_blank">For Businesses</a></li>
</ul>
</div>"""
@igorgue
igorgue / RPOPLPUSHIF.py
Created April 14, 2012 00:17
This is how I implemented it in Python
def rpoplpushif(self, source_list, destination_list, function):
"""
Does RPOPLPUSH only if the match condition specified by a function.
Returns nothing.
"""
connection = redis.Redis()
value = connection.rpop(source_list)
@igorgue
igorgue / RPOPLPUSHIF.py
Created April 14, 2012 00:12
Redis RPOPLPUSHIF
RPOPLPUSHIF source destination lambda x -> bool
" Vim syntax file
" Language: Python
" Maintainer: Dmitry Vasiliev <[email protected]>
" URL: http://www.hlabs.spb.ru/vim/python.vim
" Last Change: 2008-09-29
" Filenames: *.py
" Version: 2.6.4
"
" Based on python.vim (from Vim 6.1 distribution)
" by Neil Schemenauer <[email protected]>
using System;
using Gtk;
using Glade;
using Gecko;
// 2007, Igor Guerrero Fonseca
// A simple Gecko(Mozilla) browser
// using the Gtk# toolkit and Glade#(XML GUI for Gnome) tool
// and Gecko#(Mozilla C# binding)
// TODO: There's a lot of things that can be done in this program but,