Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

"""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
@cute
cute / .bowerrc
Created March 11, 2014 09:25 — forked from cwardzala/.bowerrc
{
"directory": "AppName/bower_components"
}
#!/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
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 ..

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
#import "SPVMainViewController.h"
@implementation SPVMainViewController
{
UIView *_weightView;
UIPanGestureRecognizer *_recog;
}
- (void)viewDidLoad
{
@cute
cute / phpfmt.sublime-settings
Created May 3, 2015 06:16
phpfmt.sublime-settings
{
"cakephp_style": true,
"format_on_save": false,
"indent_with_space": 2,
"passes":
[
"ConvertOpenTagWithEcho",
"DoubleToSingleQuote",
"AddMissingParentheses",
"PSR1OpenTags",
@cute
cute / .gitignore
Last active August 29, 2015 14:24 — forked from marcoslin/.gitignore
source.sh
@cute
cute / weibo.js
Created March 30, 2012 03:04
Fix Weibo Comment Click Bug in Opera 11.62
// ==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 March 30, 2012 08:29
Sphinx 2.0.4 GetDocinfo 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