Skip to content

Instantly share code, notes, and snippets.

jrobichaud /
Last active Mar 15, 2019
Code snippet on how to implement appropriate method mocking of inaccessible instance.
import unittest.mock
class Callee:
def __init__(self, member):
self.member = member
def do_something(self, method_argument):
def do_call():
GabLeRoux /
Last active Sep 5, 2018
Generate a new ssh key and add it to remote server's authorized_keys

1. Generate yourself a new ssh key

# Generate new ssh key (from github)
ssh-keygen -t rsa -b 4096 -C ""
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/EXAMPLE_rsa
jrobichaud /
Last active Jul 14, 2022
An attempt to create a class naming style for django


Django code style is well documented however the documentation has no statement on how to name classes. When digging the documentation we can find various examples that does not follow an obvious standard.

Abstract base class documentation

from django.db import models

class CommonInfo(models.Model):
    name = models.CharField(max_length=100)
 age = models.PositiveIntegerField()
plasticbrain / gulpfile.js
Last active Oct 15, 2020
gulp.js task to deploy code to remote servers
View gulpfile.js
* Description:
* Gulp file to push changes to remote servers (eg: staging/production)
* Usage:
* gulp deploy --target
* Examples:
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active May 18, 2022
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

matrixise /
Created Sep 2, 2013
Explain the validators of SQLAlchemy.
#!/usr/bin/env python
import datetime
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.schema import CheckConstraint
from sqlalchemy.orm import validates
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import IntegrityError
digitaljhelms / gist:4287848
Last active Aug 17, 2022
Git/GitHub branching standards & conventions
View gist:4287848


Quick Legend

Description, Instructions, Notes
Instance Branch
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:


start new with session name: