Skip to content

Instantly share code, notes, and snippets.

View kevinhowbrook's full-sized avatar
☯️

Kevin kevinhowbrook

☯️
  • localhost
  • 23:48 (UTC)
View GitHub Profile
@pirhoo
pirhoo / reindex.py
Created October 23, 2013 16:50
This Django command helps us to reindex a model (especialy with Neo4j).
# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from django.db.models.loading import get_model
class Command(BaseCommand):
help = "Reindex a given model."
args = 'app.Model'
def handle(self, *args, **options):
if not args:
@wsargent
wsargent / docker_cheat.md
Last active September 23, 2025 16:14
Docker cheat sheet
@suzannealdrich
suzannealdrich / settings.php
Last active June 28, 2017 22:27
Pantheon site environment base URL logic
if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) {
switch ($_SERVER['PANTHEON_ENVIRONMENT']) {
case 'test':
$base_url = 'http://test-example.gotpantheon.com'; // NO trailing slash!
break;
case 'dev':
$base_url = 'http://dev-example.gotpantheon.com'; // NO trailing slash!
break;
case 'live':
$base_url = 'http://www.example.com'; // NO trailing slash!
@Starefossen
Starefossen / tmux-cheats.md
Last active November 14, 2025 18:24
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@magnetikonline
magnetikonline / README.md
Last active October 29, 2025 21:22
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@jacobian
jacobian / models.py
Created February 15, 2011 18:11
An example of using many-to-many "through" to augment m2m relationships. See http://www.quora.com/How-do-you-query-with-a-condition-on-a-ManyToMany-model-in-Django for context.
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people')
class Meta:
ordering = ['name']
def __unicode__(self):