Skip to content

Instantly share code, notes, and snippets.

View guillaumepiot's full-sized avatar

Guillaume Piot guillaumepiot

View GitHub Profile
@sebmarkbage
sebmarkbage / Enhance.js
Last active January 31, 2024 18:33
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@nicksnell
nicksnell / osx-setup.md
Last active December 4, 2015 23:37
Script for setting up Homebrew and a bunch of apps

OSX Setup

  1. Software update
  2. Setup XCode
  3. Install Oh-my-ZSH

curl -L http://install.ohmyz.sh | sh

  1. Generate SSH keys
  2. Install Dotfiles
@ShawnMilo
ShawnMilo / validate_uuid4.py
Created December 3, 2013 20:55
Validating a uuid4 with Python.
from uuid import UUID
def validate_uuid4(uuid_string):
"""
Validate that a UUID string is in
fact a valid uuid4.
Happily, the uuid module does the actual
checking for us.
@drinks
drinks / gist:5447540
Last active January 10, 2022 01:33
Regenerate permissions when they get out of sync with content types in a django project (will destroy all existing permissions) I swear there used to be a management command for this...
from django.db.models import get_apps, get_models
from django.contrib.auth.management import create_permissions
Permission.objects.all().delete()
[create_permissions(app, get_models(app), 2) for app in get_apps()]
@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best