Skip to content

Instantly share code, notes, and snippets.

Ceasar Bautista Ceasar

Block or report user

Report or block Ceasar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Ceasar / manufactoria.hs
Created Jun 26, 2013
Simulation of manufactoria. WIP.
View manufactoria.hs
import qualified Data.Map as M
data Direction = N | S | E | W deriving Eq
type Location = (Int, Int)
data Sticker = Red | Blue deriving Eq
data Widget = Widget Location [Sticker]
import inspect
import re
import pprint
FUNCTION_PATTERN = re.compile(".*\s((\.|\w)+)\(")
import timeit
setup = """
def primes(n):
'''Get all primes up to n.'''
if n < 2:
return []
nums = range(n)
sieve = set(xrange(2, n))
# -*- coding: utf-8 -*-
:copyright: (c) 2011 by Armin Ronacher.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
import os
import sys
import unittest
# Start postgres
alias pgstart='pg_ctl -l $PGDATA/server.log start'
# Stop postgres
alias pgstop='pg_ctl stop -m fast'
# Postgres stuff
export PGDATA='/usr/local/var/postgres'
# Register a python project on pypi
Ceasar / dotfiles.txt
Last active Dec 17, 2015
List of my dotfiles. For use with [dots](
View dotfiles.txt
Ceasar /
Created Apr 22, 2013
Email Validator for wtforms using Django validator.
class Email(object):
message = 'Enter a valid email address.'
user_regex = re.compile(
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*$" # dot-atom
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-\011\013\014\016-\177])*"$)', # quoted-string
domain_regex = re.compile(
r'(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?$)' # domain
# literal form, ipv4 address (SMTP 4.1.3)
Ceasar / send.rb
Created Apr 4, 2013
Send a text to a number from multiple numbers.
View send.rb
# sms_bomb
# ========
# Send a bunch of texts (from multiple numbers) to a target number.
# Installation
# ------------
# `gem install twilio-ruby`
Ceasar /
Created Apr 3, 2013
Connect and stayed connected to AirPennNet.
import sys
import time
from sh import networksetup
DEVICE = 'en0'
NETWORK = u'AirPennNet'
def connect_to_network(network):
Ceasar /
Last active Dec 14, 2015
Experiments with scope in Python.
Python scope is not dynamic.
def foo():
print x
x = 0
You can’t perform that action at this time.