Skip to content

Instantly share code, notes, and snippets.

View mikelopez's full-sized avatar

Marcos Lopez mikelopez

View GitHub Profile
@mikelopez
mikelopez / gist:5700903
Created June 3, 2013 20:01
Apache configuration for node.js sites - requires mod_http, mod_proxy_http for apache2
<VirtualHost 192.168.1.10:80>
ServerAdmin dev@scidentify.info
ServerName scidentify.info
ServerAlias www.scidentify.info
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
@mikelopez
mikelopez / gist:5606887
Created May 19, 2013 06:31
updated keys for esl.ini
[ CONTROLS ]
Toggle_LSTG = 97 // J by default
Toggle_SECL = 98 // K by default
Toggle_WRNL = 99 // L by default
Toggle_SRN = 100 // H by default
Toggle_InfoPanel = 101 // M by default **
Toggle_Hazlights = 0 // Nothing/disabled by default **
Toggle_Takedowns = 221 // ] by default
Toggle_Cruise = 219 // [ by default
Chng_Pat_PRML = 85 // U by default *
@mikelopez
mikelopez / statesdata.py
Created May 16, 2013 11:46
python dictionary of United States. key = state abbrev. code and value = full state name
states = {
'AK': 'Alaska',
'AL': 'Alabama',
'AR': 'Arkansas',
'AS': 'American Samoa',
'AZ': 'Arizona',
'CA': 'California',
'CO': 'Colorado',
'CT': 'Connecticut',
'DC': 'District of Columbia',
// use dev-port 3000
var express = require('express');
var http = require('http');
var Browser = require('zombie');
var assert = require('assert');
var settings = require('../globalsettings');
var app = require('../app');
describe('Starting server and testing client urls...', function() {
@mikelopez
mikelopez / reboot-to-ubuntu.sh
Last active December 15, 2015 12:29
Use this small shell command to set Ubuntu back as your default OS on your dual OS Chromebook. Tested on Acr C7 Chromebook following the setup guide: http://arstechnica.com/gadgets/2012/12/how-to-install-ubuntu-on-acers-199-c7-chromebook/
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cgpt add -i 6 -P 5 -S 1 /dev/sda && reboot
@mikelopez
mikelopez / reboot-to-chrome.sh
Created March 28, 2013 04:51
Use this small shell command to set ChromeOS back as your default OS on your dual OS Chromebook. Tested on Acr C7 Chromebook following the setup guide: http://arstechnica.com/gadgets/2012/12/how-to-install-ubuntu-on-acers-199-c7-chromebook/
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cgpt add -i 6 -P 0 -S 1 /dev/sda && reboot
@mikelopez
mikelopez / AweberApiWrapper.py
Created February 22, 2013 05:42
subclassing the AWeber class and binding to database objects
from aweber_api import AWeberAPI
class AWeberWrapper(AWeberAPI):
""" interface between aweber_api and our database objects """
_w_access_key = None
_w_access_secret = None
_w_consumer_key = None
_w_consumer_secret = None
_w_obj = None
_w_account = None
@mikelopez
mikelopez / testrunner.py
Created January 3, 2013 21:43
Custom test runner using no databases Requires DEV_INSTALLED_APPS present in settings. modify this if you need
__author__ = 'Marcos Lopez'
# http://github.com/mikelopez
from django.test.simple import DjangoTestSuiteRunner
import settings
class BaseAppsTestNoDb(DjangoTestSuiteRunner):
def setup_databases(self, **kwargs):
""" override the db stuff from DjangoTestSuiteRunner """
pass
@mikelopez
mikelopez / video-player.js
Created October 31, 2012 19:09
Video player for samsung SDK
function SceneVideoPlayerFull(options){
this.options = options;
this.video_random_id = null;
// These item URL should be modified to contents URL to play.
this.playList = null;
}
SceneVideoPlayerFull.prototype.initialize = function(){
@mikelopez
mikelopez / settings.py
Created October 30, 2012 00:43
Multiple django version settings support for versions > 1.3
try:
from django.template.loaders.filesystem import load_template_source as todel
del(todel)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
except ImportError:
TEMPLATE_LOADERS = (