Skip to content

Instantly share code, notes, and snippets.

View epequeno's full-sized avatar

Steven Pequeno epequeno

View GitHub Profile
@epequeno
epequeno / gist:4978886
Created February 18, 2013 17:05
is_after() walkthrough 16.2
In [7]: t1 = mytime.Time(2013, 1, 1, 12)
In [8]: t1.date.ctime()
Out[8]: 'Tue Jan 1 12:00:00 2013'
In [9]: t2 = mytime.Time(2013, 1, 1, 1)
In [10]: t2.date.ctime()
Out[10]: 'Tue Jan 1 01:00:00 2013'
#!/usr/bin/python
import irclib
irclib.DEBUG = True
import time
import re
import search
@epequeno
epequeno / gist:3012099
Created June 28, 2012 15:46
raw_input and ints
In [13]: a = raw_input("Name ")
Name Steven
In [14]: a
Out[14]: 'Steven'
In [15]: type(a)
Out[15]: str
In [16]: a = raw_input("Number ")
@epequeno
epequeno / gist:2586709
Created May 3, 2012 15:49
golang string formatting
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println("The value of Pi is %1.3f", math.Pi)
}
@epequeno
epequeno / gist:1142873
Created August 12, 2011 20:03
fibonacci practice
package main
import "fmt"
//import "strconv"
var known = map[int] int{0:0, 1:1}
func fibo(n int) (result int) {
if value, ok := known[n]; ok {
result := value