Skip to content

Instantly share code, notes, and snippets.

@fernandoaleman
fernandoaleman / Linux Static IP
Created March 23, 2012 16:20
How To Configure Static IP On CentOS 6
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static

Learning Object Oriented Python

I wrote this as a guide for a financial analyst friend of mine looking to learn Python. He is already fairly well versed in doing Project Euler problems in Ruby. All italicized text is for the benefit of any other readers, such as yourself.

Each section is divided into a short resource (10 minutes or less), a long resource (days to weeks or more), and a challenge.

~

So what you're looking to do is to be able to recreate financial models in code. And other types of models. This is a noble pursuit.

@scshepard
scshepard / use_git.md
Last active August 29, 2015 14:11 — forked from amandabee/use_git.md

Git is a version control system. Github is a proprietary hosting service that manages central git repositories. A git repository doesn't have to be public, but there are some great free hosts available if you do want to make your work available. Github, obviously, or Gitorious, especially if you're offended by github's ugly gender politics. Github's GUI is much nicer than any generalized Git GUI's I've seen, which is a vote for using Github, but it really doesn't matter.

So here are a few good reasons you should use git to manage teaching materials:

  • Greg Wilson explains it pretty well to a Python conference. You have to listen to him talk about a few other things first, but the whole talk is interesting so go ahead.

Any newsroom with an

import numpy as np
import pandas as pd
from bs4 import BeautifulSoup, element
import urllib2, re
# Read the HTML from the webpage on Wikipedia stats and convert to soup
soup = BeautifulSoup(urllib2.urlopen('http://stats.wikimedia.org/EN/TablesWikipediaEN.htm').read())
# Look for all the paragraphs with 2014
_p = soup.findAll('b',text=re.compile('2014'))

Git Cheat Sheet

Commands

Getting Started

git init

or

@scshepard
scshepard / readme.md
Last active August 29, 2015 14:21 — forked from max-mapper/readme.md

experimental zip stream parsing

using punzip, which uses mount-url and yauzl

problem: theres a 500mb ZIP with a few CSVs in it, but you only care about one of the files and dont want to download the whole thing and have to unzip the whole zip just to get the one file

  1. brew install osxfuse (or however you install fuse on your OS)
  2. npm install punzip csv-parser -g
  3. punzip http://download.cms.gov/Research-Statistics-Data-and-Systems/Statistics-Trends-and-Reports/Medicare-Provider-Charge-Data/Downloads/PartD_Prescriber_PUF_NPI_DRUG_13.zip --entry=2 | csv-parser --separator=$'\t'
# Alexandre rANGEL
# "ascension hill" (v14)
# www.quasecinema.org
# 26-Mar-2016
# Sonic Pi 2.9
myBPM = 144
bpmDivider = 2
use_bpm myBPM
set_volume! 1.0 # the age of
@Enkerli
Enkerli / spi_midi_wx11.txt
Last active April 9, 2016 06:46
Quick Sonic Pi script using MIDI in from a WX11 wind controller to control amplitude. Based on Robin Newman’s blogpost: https://rbnrpi.wordpress.com/2016/04/01/a-completely-different-way-to-use-sonic-pi-with-a-midi-controller/
require 'drb/drb'
DRB_URI="drbunix:/var/tmp/sonic-pi-midiconnector"
@midi = DRbObject.new_with_uri(DRB_URI)
use_bpm 240
use_synth :dtri
note_node=play 60, release: 100, attack: 1
live_loop :ctl do
control note_node, amp: @midi.k2/127.0