Skip to content

Instantly share code, notes, and snippets.

View gevent_pycurl.py
"""Implementation of pycurl's "easy" interface that uses pycurl's multi interface + gevent.
"""
# parts of code from Tornado's curl_httpclient.py
import logging
import gevent
assert gevent.version_info[:2] >= (0, 14), 'Gevent 0.14 or older required. Your version is %s' % gevent.__version__
from gevent.core import EVENTS, READ, WRITE
from gevent.hub import Waiter
View .bowerrc
{
"directory": "AppName/bower_components"
}
View install_pytho27.sh
#!/bin/sh
mkdir ~/down/
cd ~/down/
sudo apt-get install build-essential
wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
tar -xzf Python-2.7.2.tgz
cd Python-2.7.2
sudo apt-get install libsqlite3-dev zlib1g-dev libncurses5-dev
sudo apt-get install libgdbm-dev libbz2-dev libreadline5-dev
sudo apt-get install libssl-dev libdb-dev
View python27_on_debian.sh
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar -xzf Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/usr --enable-shared
make
sudo make install
cd ..
View graphite.md

This is a general overview (from memory) of the steps I used to install graphite (http://graphite.wikidot.com) on OS X Lion. I think the steps are in order but YMMV. Please fork and fix if you find an error.

Install Python 2.7.2

curl -kL http://xrl.us/pythonbrewinstall | bash
echo '[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc' >> ~/.bashrc
[[ -s $HOME/.pythonbrew/etc/bashrc ]] && source $HOME/.pythonbrew/etc/bashrc
pythonbrew install 2.7.2
pythonbrew use 2.7.2
pythonbrew venv create graphite
View SPVMainViewController.m
#import "SPVMainViewController.h"
@implementation SPVMainViewController
{
UIView *_weightView;
UIPanGestureRecognizer *_recog;
}
- (void)viewDidLoad
{
@cute
cute / phpfmt.sublime-settings
Created May 3, 2015
phpfmt.sublime-settings
View phpfmt.sublime-settings
{
"cakephp_style": true,
"format_on_save": false,
"indent_with_space": 2,
"passes":
[
"ConvertOpenTagWithEcho",
"DoubleToSingleQuote",
"AddMissingParentheses",
"PSR1OpenTags",
@cute
cute / weibo.js
Created Mar 30, 2012
Fix Weibo Comment Click Bug in Opera 11.62
View weibo.js
// ==UserScript==
// @name Fix KeyboardEvent
// @namespace weibo
// @include http://weibo.com/*
// @include http://www.weibo.com/*
// ==/UserScript==
(function (){
window.KeyboardEvent=window['KeyboardEvent']||null;
})();
@cute
cute / GetDocinfo-2.0.4.patch
Created Mar 30, 2012
Sphinx 2.0.4 GetDocinfo Patch
View GetDocinfo-2.0.4.patch
diff -rup sphinx-2.0.4-release/api/sphinxapi.php 2.0.4/api/sphinxapi.php
--- sphinx-2.0.4-release/api/sphinxapi.php 2012-01-31 07:07:35.000000000 +0800
+++ 2.0.4/api/sphinxapi.php 2012-03-30 16:39:25.000000000 +0800
@@ -27,6 +27,7 @@ define ( "SEARCHD_COMMAND_KEYWORDS", 3 )
define ( "SEARCHD_COMMAND_PERSIST", 4 );
define ( "SEARCHD_COMMAND_STATUS", 5 );
define ( "SEARCHD_COMMAND_FLUSHATTRS", 7 );
+define ( "SEARCHD_COMMAND_DOCINFO", 9 );
/// current client-side command implementation versions