Skip to content

Instantly share code, notes, and snippets.

jrobichaud /
Last active March 15, 2019 17:48
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 September 5, 2018 18:49
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 February 18, 2023 17:34
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 October 15, 2020 14:28
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 October 8, 2023 02:00
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 September 2, 2013 21:09
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 November 28, 2023 15:04
Git/GitHub branching standards & conventions
View gist:4287848


Quick Legend

Description, Instructions, Notes
Instance Branch
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 28, 2023 19:57
tmux shortcuts & cheatsheet
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
andreyvit /
Created June 13, 2012 03:41
tmux cheatsheet

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: