Skip to content

Instantly share code, notes, and snippets.

View john2x's full-sized avatar
👨‍👩‍👦‍👦

John Louis Del Rosario john2x

👨‍👩‍👦‍👦
View GitHub Profile
[flake8]
max-line-length=120
exclude=backend/tests/*,backend/lib/*
class Container(object):
def __init__(self, items):
self.items = items # items is a list or tuple
def __len__(self):
return len(self.items)
def __getitem__(self, i):
return self.items[i]
String.prototype.format = function() {
var formatted = this;
for(arg in arguments) {
formatted = formatted.replace("{" + arg + "}", arguments[arg]);
}
return formatted;
};
$(document).ready(function() {
$("#form-book-search").submit(function(event){
**RPSO - Sales Order Document
PARAMETERS lcFilter, lcDateRange, lcSortRange, lcAdvFilter, lcOtherVariable, lcSortOrder
***JDM--CR 80887--3/18/02--Need the following variables.
LOCAL lcSql, lcSql1, lcSql2, lcSql3, lcSql4, lcSql5, lcSql6, lcSql7, lcSql8, lcSql9
LOCAL lcSql0, lcSql11, lcSql12, lcSql13, lcSql14, lcSql15, lcSql16, lcSql17, lcSql18, lcSql19
LOCAL lcSql20, lcSql21, lcSql22, lcSql23
LOCAL lnHandle, lnReturn, lcSortRange2
@john2x
john2x / tshirt.css
Created June 20, 2011 09:37
reference for new theme
@import "reset.css";
body{
background: url("grid.png") repeat-y;
font-family: helvetica, arial;
}
#header-nav{
position: absolute;
right: 20px;
top: 85px;
font-size: 2em;
@john2x
john2x / openerp-requirements.txt
Created August 11, 2012 03:30
OpenERP requirements
# openERP requirements
#
# $ apt-get install libldap2-dev libsasl2-dev
# $ apt-get install python-libxslt1 python-webdav
# $ virtualenv --system-site-packages /var/www/openerp/venv
# $ source /var/www/openerp/venv/bin/activate
# (venv)$ pip install -r openerp-requirements.txt
# install PIL http://www.sandersnewmedia.com/why/2012/04/16/installing-pil-virtualenv-ubuntu-1204-precise-pangolin/
# $ sudo apt-get build-dep python-imaging
# $ sudo ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/
@john2x
john2x / local.py
Created October 23, 2012 09:34
SDC Test
import webapp2
from google.appengine.api import urlfetch
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers["Content-Type"] = "text/plain"
self.response.write("John")
app = webapp2.WSGIApplication(
@john2x
john2x / getin.py
Last active December 17, 2015 02:48
inspired by Clojure's get-in function
def getin(d, keys, default=None):
'''
>>> d = {'foo': {'bar': {'baz': 1}}}
>>> getin(d, ['foo', 'bar', 'baz'])
1
>>> getin(d, ['foo', 'bar'])
{'baz': 1}
>>> getin(d, ['foo', 'oops'], default=0)
0
'''
@john2x
john2x / ttest.md
Last active December 18, 2015 12:09
markdown test

Collabspot Highrise Changelog

2013-06-14

New fetures

  • Foo
  • Bar

Bug fixes

  • fix for quux
@john2x
john2x / github.vim
Created August 24, 2013 07:32
Github colors for Vim
" Vim color file
"
" Original Author: Anthony Carapetis <anthony.carapetis@gmail.com>
" Author: John Louis Del Rosario @john2x
"
" Note: Based on github's syntax highlighting theme
" Used Brian Mock's darkspectrum as a starting point/template
" Thanks to Ryan Heath for an easy list of some of the colours:
" http://rpheath.com/posts/356-github-theme-for-syntax-gem
"