Skip to content

Instantly share code, notes, and snippets.

View philippeowagner's full-sized avatar

Philippe O. Wagner philippeowagner

View GitHub Profile
@cube-drone
cube-drone / automation.md
Last active March 26, 2024 20:24
Automation For The People

Automation for the People

Long ago, the first time I read "The Pragmatic Programmer", I read some advice that really stuck with me.

"Don't Use Manual Procedures".

This in the chapter on Ubiquitous Automation. To summarize, they want you to automate all the things.

The trouble was that I hadn't much of an idea how to actually go

@sephii
sephii / check_migrations.sh
Last active June 7, 2016 15:30
Django: make tests fail if you forgot to generate migrations
#!/bin/sh
./manage.py makemigrations --dry-run -e --no-input -v1 && echo "Missing migrations detected!" && exit 1; exit 0
@bboe
bboe / github_protect_master.py
Created December 15, 2015 19:22
Enable master branch protection on all github repositories you are an owner of.
#!/usr/bin/env python
from __future__ import print_function
REPO_URL = 'git+git://github.com/sigmavirus24/github3.py.git'
import os
import sys
try:
from github3 import login
except ImportError:

I upgraded to El Capitan, with Homebrew & Ruby, and this is how I did it flawlessly.

... and Xcode and Java, etc.

Prepare

If you don't already have homebrew installed, do that first, so you don't have to deal with SIP issues. Install all Software Updates available in the Apple Menu, up to and including El Capitan.

Hardware

@theskumar
theskumar / compat.py
Created June 14, 2014 05:35
Django Compatibility
import django
from django.conf import settings
from django.utils import six
# Django 1.5 add support for custom auth user model
if django.VERSION >= (1, 5):
AUTH_USER_MODEL = settings.AUTH_USER_MODEL
else:
AUTH_USER_MODEL = "auth.User"
@philippeowagner
philippeowagner / gist:6794344
Last active December 24, 2015 11:59
Remove all .pyc files.
find -type f -name "*.pyc" -delete
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@shazron
shazron / ios7.phonegap.cordova.js
Last active December 23, 2015 07:39
PhoneGap / Apache Cordova - top margin for iOS 7
// Pre-requisites:
// 1. Device core plugin
// 2. Splashscreen core plugin (3.1.0)
// 3. config.xml: <preference name="AutoHideSplashScreen" value="false" />
// 4. config.xml: <preference name="DisallowOverscroll" value="true" />
function onDeviceReady() {
if (parseFloat(window.device.version) >= 7.0) {
document.body.style.marginTop = "20px";
// OR do whatever layout you need here, to expand a navigation bar etc
@philippeowagner
philippeowagner / gist:6530635
Last active November 25, 2020 13:02
Having troubles with 'latin1_swedish_ci' on your MySQL Databases? Specially `OperationalError (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='")`? No problem, fix it using Django's shell.This solution is based on this http://stackoverflow.com/questions/1073295/django-character-set-w…
from django.db import connection
from django.conf import settings
cursor = connection.cursor()
cursor.execute('SHOW TABLES')
results=[]
for row in cursor.fetchall():
results.append(row)
for row in results:
cursor.execute('ALTER TABLE %s CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' % (row[0]))
@brandonb927
brandonb927 / LICENSE.md
Last active October 11, 2020 09:13 — forked from valpackett/LICENSE.md
Use Markdown in Evernote with Marked.app
       DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
               Version 2, December 2004

Copyright (C) 2012 Brandon B. brandon@brandonbrown.io

Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE