Skip to content

Instantly share code, notes, and snippets.

View jalaziz's full-sized avatar

Jameel Al-Aziz jalaziz

  • Paradigm Connect
  • Los Angeles, CA
  • X @jalaziz
View GitHub Profile
@paul-english
paul-english / jquery-validate-bootstrap-patch.coffee
Created March 26, 2012 03:51
Monkey patches that are designed to help jquery-validate work well with Twitter Bootstrap
# These patches help make the jquery validator work well with
# the Twitter Bootstrap html & class conventions
#
# MONKEY-PATCH warning
# These may need to be adjusted if upgrading or changing jquery-validate
# from 1.9.0
$.validator.setDefaults
errorClass: "error"
validClass: "success"
@solidsnack
solidsnack / syslogged
Created July 26, 2013 18:08
Wrapper for logging any command's STDOUT and STDERR to syslog.
#!/bin/bash
set -o errexit -o nounset -o pipefail
function -h {
cat <<EOF
USAGE: syslogged <program> <args>
Wraps a command invocation with logging, sending STDOUT and STDERR to
syslog, setting the syslog tag to:
<program>[<pid>]
AUTHENTICATION_BACKENDS = (
'social_auth.backends.google.GoogleOAuth2Backend',
'django.contrib.auth.backends.ModelBackend',
)
LOGIN_REDIRECT_URL = '/'
GOOGLE_OAUTH2_CLIENT_ID = os.environ['GOOGLE_OAUTH2_CLIENT_ID']
GOOGLE_OAUTH2_CLIENT_SECRET = os.environ['GOOGLE_OAUTH2_CLIENT_SECRET']
GOOGLE_WHITE_LISTED_DOMAINS = ['incuna.com']
SOCIAL_AUTH_USER_MODEL = 'auth.User'
To get started with Docker/Marathon/Mesos, you need to install a
new Mesos, a new Marathon, and Deimos, the bridge to Docker.
You'll also need Docker and the JVM. These instructions are for
Ubuntu 13.10.
## Install Mesos prerequisites
:; sudo apt-get update
:; sudo apt-get install zookeeperd default-jre python-setuptools python-protobuf curl pip
## Install recent Mesos
@rcrowley
rcrowley / whisper-clean.py
Created July 20, 2012 23:35
Clean up Whisper files that no longer map to this host.
import os
import os.path
import sys
from graphite.render.hashing import ConsistentHashRing
instances = []
unwelcome_instances = []
for arg in sys.argv[1:]:
unwelcome = False
@andreineculau
andreineculau / get-aws-cli-sts.js
Created December 22, 2017 10:55
fucking get aws-sdk-js to read your aws-cli assumed role
import aws from 'aws-sdk';
import fs from 'fs';
import ini from 'ini';
import path from 'path';
// compatibility with aws-cli
let cliCacheFolder = path.join(process.env.HOME, '.aws', 'cli', 'cache');
let awsProfile = process.env.AWS_PROFILE || process.env.AWS_DEFAULT_PROFILE;
if (awsProfile) {
try {
global
log logstash local0 #Change logstash to your naming
log-send-hostname
chroot /var/lib/haproxy
user haproxy
group haproxy
daemon
maxconn 4000
defaults
@chalmerj
chalmerj / gist:1492384
Created December 18, 2011 04:39
Init script for Graphite carbon-cache
#! /bin/sh
### BEGIN INIT INFO
# Provides: carbon-cache
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: carbon-cache init script
# Description: An init script for Graphite's carbon-cache daemon.
### END INIT INFO
@pzrq
pzrq / mro_exploration.py
Last active December 15, 2020 07:18
Better PyCharm mixin handling would make it far more useful for Django Class-Based Views, Managers, etc
# -*- coding: utf-8 -*-
"""
# usage: python mro_exploration.py
# https://github.com/pzrq/
Better PyCharm mixin handling would make it far more useful for
Django Class-Based Views, Managers, and in contexts others have identified
such as Werkzeug.
https://youtrack.jetbrains.com/issue/PY-7712
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(