This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://phpconfigure.com/ | |
See before: | |
compile.mysql5.6.12.txt & compile.apache2.4.4.txt | |
Compile php 5.3.25 | |
sudo mkdir /usr/local/php | |
sudo mkdir /usr/local/php/php_5.3.25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simple example that takes a command line provided serial port destination and routes the output to a file of the same name with .log appended to the port name. | |
usage: node logger.js /dev/tty.usbserial <baudrate> | |
*/ | |
var SerialPort = require("serialport"); | |
var fs = require("fs"); | |
var port = process.argv[2]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day job: Software Craftsman | |
Favorite Ruby project: github-gem, octopress, sinatra, hirefire... well, I love'em all :) | |
Open Source contributions: few Chef(opscode) cookbooks, the modules and patches for seagull and symfony frameworks, little magento additions http://tinycarts.github.com/ and others patches, fixes, gists, I'm sure you know the rest ;) | |
How do you use GitHub: blogging, collaborating, contributing and sharing the code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STDOUT.sync = true | |
require 'queue' | |
start_time = Time.now.to_i | |
msg = 0 | |
queue = Queue.new("testing") | |
queue.subscribe do |obj| | |
msg += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## from libcloud.types import Provider | |
## from libcloud.providers import get_driver | |
require 'fog/types' | |
require 'fog/providers' | |
## EC2 = get_driver(Provider.EC2) | |
## Slicehost = get_driver(Provider.SLICEHOST) | |
## Rackspace = get_driver(Provider.RACKSPACE) | |
EC2 = Fog::Provider.new(:ec2) # syntax 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Recursively add a .gitignore file to all directories | |
# in the working directory which are empty and don't | |
# start with a dot. Helpful for tracking empty dirs | |
# in a git repository. | |
for i in $(find . -type d -regex ``./[^.].*'' -empty); do touch $i"/.gitignore"; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "sf", | |
icon: "http://www.symfony-project.org/favicon.ico", | |
author: { name: "Ajai Khattri", email: "[email protected]"}, | |
license: "GPL", | |
description: "Searches the symfony API docs for words.", | |
takes: {"search term": noun_arb_text}, | |
preview: function(pblock, directObject, modifiers) { |