Skip to content

Instantly share code, notes, and snippets.

View epequeno's full-sized avatar

Steven Pequeno epequeno

View GitHub Profile
@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
@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: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 ")
#!/usr/bin/python
import irclib
irclib.DEBUG = True
import time
import re
import search
@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'
@epequeno
epequeno / gist:5898551
Created July 1, 2013 05:30
not a bad sentiment tho
The reader will discover on
his or her own that every page exudes energy and passion,
that the logic of his argument is impossibly compelling, and
that the intellectual fire that inspired this work burns as bright
now as it did all those years ago.
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/English
bind-address = 65.55.55.2
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "sprbt.py", line 123, in run
self.allmessages += functions.actioner(g, message, username, channel, self.channel)
File "/home/student/Downloads/humanitybot-0.1/functions.py", line 77, in actioner
messages += player.printCards()
AttributeError: 'bool' object has no attribute 'printCards'
@epequeno
epequeno / gist:000acfc119450be2b19c
Last active August 29, 2015 14:00
A simple script to create a MySQL db and table
MAKE SURE ALL FILES ARE IN THE SAME FOLDER
in a file named lab.sh:
#!/bin/bash
mysql < mysql.sql
mysqldump FastFood > station12.sql
rsync -P station12.sql coby@172.21.101.105:~/
in a file named mysql.sql:
/*
@font-face {
font-family: 'raleway';
src: url('../fonts/raleway/webfonts/raleway_thin-webfont.ttf') format('truetype'), url('../fonts/raleway/webfonts/raleway_thin-webfont.eot') format('eot'), url('../fonts/raleway/webfonts/raleway_thin-webfont.woff') format('woff');
}
*/