Skip to content

Instantly share code, notes, and snippets.

View gist:d091515703672ec0bf1a6271336806f0
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc
! unzip -qq -n
#Setup sshd
! apt-get install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen > /dev/null
#Set root password
muendelezaji /
Created Oct 5, 2016 — forked from op/
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is how I used it:
# $ cat ~/.bash_history | python >> ~/.zsh_history
import sys
import time
nhmc / mortgage_repayments.ipynb
Created Feb 11, 2016
A mortgage repayment calculator written in Python using a Jupyter notebook
View mortgage_repayments.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
spuder /
Last active May 26, 2021
python script to generate .pdf and .gerber files from a kicad project
Heavily borrowed from this location:
Takes 2 parameters
1. Path to kicad file
2. Location of where to save pdfs
A python script example to create various plot files from a board:
patik /
Last active Jun 6, 2021
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

pachacamac / clap.html
Last active May 2, 2021
Clap Detection in JS
View clap.html
<style>* {box-sizing: border-box;}</style>
<p>If you're happy and you know it, clap your hands!</p>
var Recording = function(cb){