Skip to content

Instantly share code, notes, and snippets.

View justhamade's full-sized avatar

Justin Hamade justhamade

View GitHub Profile
@justhamade
justhamade / product.json
Created November 7, 2019 17:07
Example Product
{
"code": "TEO",
"constant": "TECH_EMISSION_AND_OMISSIONS",
"name": "Technology Errors and Omissions",
"path": "/tech-e-and-o",
"productId": "fc1ab8a2-3ac9-4f6f-9c58-e51f35e98af1",
"insurerGroup": "Berkley Insurance Company",
"insurerId": "1a6f63e9-1c2e-4f0a-bf79-0acaebba9781",
"eligibility": {
"maximumDaysInAdvance": 60,
#!/bin/sh
#
# Custom Git merge driver - merges PO files using msgcat(1)
#
# - Install gettext
#
# - Place this script in your PATH
#
# - Add this to your .git/config :
#
#!/bin/bash
# Run with curl https://gist.github.com/justhamade/633013c13e29e72c1080 | sh
yum clean metadata
yum clean all
yum update -y
yum groupinstall "Development tools" -y
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
@justhamade
justhamade / stackato.yml
Last active December 20, 2015 11:29
Stackato example stackato.yml
name: stackto-demo
framework:
type: python
runtime: python27
min_version:
client: 1.5.1
env:
DJANGO_SETTINGS_MODULE: settings.production
requirements:
pip:
@justhamade
justhamade / settings.py
Created July 31, 2013 17:07
Stackato Example settings.py
import urlparse
DATABASES = {}
if 'DATABASE_URL' in os.environ:
url = urlparse.urlparse(os.environ['DATABASE_URL'])
DATABASES['default'] = {
'NAME': url.path[1:],
'USER': url.username,
'PASSWORD': url.password,
'HOST': url.hostname,
'PORT': url.port,
@justhamade
justhamade / settings.py
Created July 6, 2013 00:15
Stackto Blog Post Snippets
import urlparse
DATABASES = {}
if 'DATABASE_URL' in os.environ:
url = urlparse.urlparse(os.environ['DATABASE_URL'])
DATABASES['default'] = {
'NAME': url.path[1:],
'USER': url.username,
'PASSWORD': url.password,
'HOST': url.hostname,
'PORT': url.port,
@justhamade
justhamade / find.sh
Created June 14, 2013 23:46
Find all strings that are not in any file in the current directory or its children
#!/bin/bash
FILE=find.txt
DIRECTORY=fmep
while read f; do
echo "Searching for $f"
line=$(find $DIRECTORY -type f -exec grep -Hn $f {} \;)
if [ -z "${line}" ]; then
echo "$f NOT FOUND"
fi
@justhamade
justhamade / justins-apps.yaml
Last active December 17, 2015 16:29
Stackato App Store
store:
title: Justins Stackato Applications
contact: Justin Hamade <justin@openroad.ca>
icon: 901uhl.png
icon-url: http://i42.tinypic.com/
src-url: https://github.com/justhamade/
defaults:
id: $id-from-name
mem: 128
src: $id.git
from django.contrib import admin
from django.contrib.admin import ChoicesFieldListFilter
from django.contrib.admin.views.main import ChangeList
from django.utils.http import urlencode
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_text
from .models import Person
@justhamade
justhamade / AJAX Auth
Created December 13, 2012 00:55
AJAX cross domain auth
$.ajaxSetup({$
xhrFields: {$
withCredentials: true$
},$
crossDomain: true,$
statusCode: {$
401: function(){$
// Redirec the to the login page.$
console.log('401');$
//window.location.replace('/web/#login');$