Skip to content

Instantly share code, notes, and snippets.

@shingonoide
shingonoide / gist:8172291
Created December 29, 2013 16:58
Trying to install PIL "pip install PIL" and got this error.
building '_imagingft' extension
gcc -pthread -fno-strict-aliasing -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protecto
r --param=ssp-buffer-size=4 -fPIC -I/usr/include/freetype2 -IlibImaging -I/home/cafeerp/instances/cafeerp_ocb7/include -I/usr/local/include -I/usr/include -I/usr/include/python2.7 -
c _imagingft.c -o build/temp.linux-x86_64-2.7/_imagingft.o
_imagingft.c:73:31: fatal error: freetype/fterrors.h: No such file or directory
#include <freetype/fterrors.h>
@khalib
khalib / cms_install.sh
Last active October 3, 2017 09:26
MNPP: Mac/Nginx/Percona-MySQL/PHP install via Homebrew
# Install Xcode
xcode-select --install
# Install Homebrew.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew update
# Install git.
brew install git
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active March 12, 2026 12:41
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@fprieur
fprieur / autoreload-Gunicorn
Last active April 16, 2023 14:28
Auto Reload Gunicorn On File Change Event
pip install watchdog -U
# now there is a command called "watchmedo", you'll like it...
# in terminal #1, run:
gunicorn app:myapp --pid=gunicorn.pid
# in terminal #2, run:
watchmedo shell-command \
--patterns="*.py;*.html;*.css;*.js" \
--recursive \
@tauzen
tauzen / urls.py
Created February 1, 2014 13:49
Example of using login_required and staff_member_required decorators with Class-based views in Django.
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib import admin
from application.views import ApplicationFormView, ApplicationListView
admin.autodiscover()
urlpatterns = patterns('',
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active February 15, 2026 20:33
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@Bouke
Bouke / gist:11261620
Last active January 7, 2026 00:43
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@Qt-dev
Qt-dev / backendData.js
Created July 3, 2014 09:55
An accordion in ReactJS/CSS3
var backendData = [
{
"title":"Section 1",
"content":"Our content for the section 1"
},
{
"title":"Section 2",
"content":"Our content for the section 2"
},
{
@wdullaer
wdullaer / install.sh
Last active March 11, 2026 09:02
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active February 5, 2026 18:38
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):