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
View connect.py
import sys
import time
from sh import networksetup
DEVICE = 'en0'
NETWORK = u'AirPennNet'
NETWORK = u'Lovers&Madmen'
View fabfile.py
"""
fab -H [hostname] [command]
"""
from fabric.api import run
HOME = '/Users/ceasarbautista'
def authorize():
View memoize.coffee
_ = require "lodash"
memoize = (f) ->
cache = {}
memoizer = ->
args = Array.prototype.slice.call(arguments)
if _.has(cache, args) then cache[args] else cache[args] = f.apply this, args
return memoizer
fib = (n) ->
@Ceasar
Ceasar / lex.py
Last active Aug 29, 2015
problem with python scope.
View lex.py
"""
there is no way good way to make this append() function, which is unfortuante because we want the two lines in it to be atomic.
"""
def _lex(line):
tokens = []
token = ""
whitespace = {' '}
escape_chars = {'\\'}
escape = False
@Ceasar
Ceasar / imap
Last active Aug 29, 2015
Gmail IMAP bug
View imap
* OK Gimap ready for requests from 67.164.75.146 cz17mb41670502pac
x login cbautista2010@gmail.com PASSWORD
* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH
x OK cbautista2010@gmail.com Ceasar Bautista authenticated (Success)
x select Gregory
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $Phishing $NotJunk NotJunk $NotPhishing $Junk)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $Phishing $NotJunk NotJunk $NotPhishing $Junk \*)] Flags permitted.
* OK [UIDVALIDITY 619011903] UIDs valid.
* 69 EXISTS
* 0 RECENT
@Ceasar
Ceasar / deps.py
Created Aug 28, 2014
Different ways to resolve dependencies
View deps.py
# Manual constructor injection
class Charlie:
pass
class Beta:
def __init__(self, charlie):
self.charlie = charlie
class Alpha:
@Ceasar
Ceasar / uri_template.py
Last active Aug 29, 2015
Implements a Level 3 expand function for RFC 6570 URI Templates.
View uri_template.py
from urllib import quote
_OP_LEVEL_2 = {'+', '#'}
_OP_LEVEL_3 = {'.', '/', ';', '?', '&'}
OPERATORS = _OP_LEVEL_2 | _OP_LEVEL_3
_RESERVED = ':/?#[]@' + '!$&\'()*+,;='
class Token(object):
View traffichistory.rb
#/usr/bin/ruby
require "cgi"
require "base64"
require "openssl"
require "digest/sha1"
require "uri"
require "net/https"
require "rexml/document"
require "time"
View gist:1114213
C:\Program Files (x86)\Android\android-sdk-windows\tools>cd \
C:\>echo %USERPROFILE%
C:\Users\Ceasar
C:\>echo %PATH%
C:\Program Files (x86)\Java\jdk1.6.0_23\bin;C:\Ruby192\bin;C:\Program Files (x86
)\Git\bin;C:\Python26;C:\Python26\Scripts;C:\Program Files (x86)\Android\android
-sdk-windows\tools;C:\Program Files (x86)\scala\bin
View gist:1114363
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Ceasar>systeminfo
Host Name: BAUTISTC-PC
OS Name: Microsoft Windows 7 Home Premium
OS Version: 6.1.7600 N/A Build 7600
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
You can’t perform that action at this time.