Skip to content

Instantly share code, notes, and snippets.

@yevgenko
yevgenko / useful_pandas_snippets.py
Created January 30, 2017 02:46 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# 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)]
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
@yevgenko
yevgenko / seriallogger.js
Created January 3, 2012 17:05 — forked from voodootikigod/seriallogger.js
Log all output from a serial port connection to a log file.
/*
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];
@yevgenko
yevgenko / Questions
Created September 7, 2011 21:21
RubyShift
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
STDOUT.sync = true
require 'queue'
start_time = Time.now.to_i
msg = 0
queue = Queue.new("testing")
queue.subscribe do |obj|
msg += 1
## 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
# 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;
@yevgenko
yevgenko / x
Created April 17, 2009 02:39 — forked from symbiat/x
CmdUtils.CreateCommand({
name: "sf",
icon: "http://www.symfony-project.org/favicon.ico",
author: { name: "Ajai Khattri", email: "ajai@bitblit.net"},
license: "GPL",
description: "Searches the symfony API docs for words.",
takes: {"search term": noun_arb_text},
preview: function(pblock, directObject, modifiers) {