Skip to content

Instantly share code, notes, and snippets.

View ronbeltran's full-sized avatar

Ronnie Beltran ronbeltran

View GitHub Profile
import random
ATTACKS = ('Cowboy', 'Ninja', 'Bear')
COWBOY = 0
NINJA = 1
BEAR = 2
@ronbeltran
ronbeltran / build-erlang-17.0.sh
Last active September 2, 2015 08:14 — forked from bryanhunter/build-erlang-17.0.sh
Build Erlang 17.0 on a fresh Ubuntu box (tested on 12.04 and 14.04)
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh
# chmod u+x build-erlang-17.0.sh
# sudo ./build-erlang-17.0.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
#!/usr/bin/env python
# http://support.sugarcrm.com/02_Documentation/04_Sugar_Developer/Sugar_Developer_Guide_6.7/02_Application_Framework/Authentication/Oauth/
# pip install oauth2
import urllib
import urlparse
import oauth2 as oauth
SUGAR_INSTANCE_URL = 'REPLACE-WITH-YOUR-SUGAR-URL'
@ronbeltran
ronbeltran / gist:7fef58801bb1f173a92a
Last active August 29, 2015 14:27 — forked from jmertic/gist:5844627
Sample Java code using Jersey and JSONObject for connecting to the new RESTful SugarCRM REST API in 6.7 and later.
package com.sugarcrm.client;
import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import net.sf.json.JSONObject;
public class JerseyClientPost {
public static void main(String[] args) {
@ronbeltran
ronbeltran / sugar7_ubuntu_12.04_install.md
Created June 22, 2015 05:47
Install Sugar 7 CRM in Ubuntu 12.04
@ronbeltran
ronbeltran / app.py
Last active August 29, 2015 14:22 — forked from berlotto/app.py
_slugify_strip_re = re.compile(r'[^\w\s-]')
_slugify_hyphenate_re = re.compile(r'[-\s]+')
def slugify(value):
"""
Normalizes string, converts to lowercase, removes non-alpha characters,
and converts spaces to hyphens.
From Django's "django/template/defaultfilters.py".
"""
import unicodedata
@ronbeltran
ronbeltran / Makefile
Last active August 29, 2015 14:22 — forked from turicas/Makefile
test:
clear
nosetests --with-coverage --cover-package name_utils test_name_utils.py
clean:
find -regex '.*\.pyc' -exec rm {} \;
find -regex '.*~' -exec rm {} \;
.PHONY: test clean
var monthly_plans = [
{
"id": "plus-monthly",
"name": "Plus",
"billing_cycle": "monthly",
"period_length": "months_1",
"monthly_price": 6.0,
"total_price": 6.0,
"selected": false,
"disabled": false,

React.js Minimal Entropy Guide

DO's:

  • Use explicit contracts to pipe data & events between systems
  • Business rules should bubble towards the top, UI and semantics should sink towards the bottom

DONT's:

@ronbeltran
ronbeltran / gist:81452333901ea2aa38de
Created May 15, 2015 02:36
appcfg.py always having server not found error on deploying code.
appcfg.py update appengine/
10:27 AM Application: myapp-id; version: 1
10:27 AM Host: appengine.google.com
10:28 AM
Starting update of app: myapp-id, version: 1
10:28 AM Getting current resource limits.
10:28 AM Scanning files on local disk.
10:28 AM Scanned 500 files.
Could not guess mimetype for static/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf. Using application/octet-stream.
Could not guess mimetype for static/lib/bootstrap/css/bootstrap-theme.css.map. Using application/octet-stream.