Skip to content

Instantly share code, notes, and snippets.


Lloyd Hughes system123

View GitHub Profile
Shaunakde /
Created Nov 30, 2020
Fast rsync from mac to linux

This set of parameters experimentally seems to work the best for macos to linux file transfer. This is ofcourse not secure and is intended for transferring things like machine learning datasets to a workstation from a laptop etc.


rsync -rltv --progress --human-readable --delete -e 'ssh -T -c -o Compression=no -x'


  • r: Recursive. Allow directories to be traversed and copied.
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
mrkpatchaa /
Last active Sep 18, 2021
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click)

  2. Use one tab to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

al42and /
Created Jan 19, 2016
Kittler-Illingworth Thresholding
import numpy as np
def Kittler(im, out):
The reimplementation of Kittler-Illingworth Thresholding algorithm by Bob Pepin
Works on 8-bit images only
Original Matlab code:
Paper: Kittler, J. & Illingworth, J. Minimum error thresholding. Pattern Recognit. 19, 41–47 (1986).
h,g = np.histogram(im.ravel(),256,[0,256])
wanghailei /
Last active Apr 30, 2021
Code snippets of All Seeing Eye
# The following code and the code generated art works are the intellectrual properities of Hailei Wang.
# © 2009 - 2014, Hailei Wang. All rights reserved.
from nodebox import geo
colors = ximport("colors")
# Define Brush
def composeimage( x, y, colr, radius, points, diminish ) :
TSiege / The Technical Interview Cheat
Last active Oct 17, 2021
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.
View The Technical Interview Cheat


I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!


kachayev /
Last active Oct 17, 2021
Dijkstra shortest path algorithm based on python heapq heap implementation
from collections import defaultdict
from heapq import *
def dijkstra(edges, f, t):
g = defaultdict(list)
for l,r,c in edges:
q, seen, mins = [(0,f,())], set(), {f: 0}
while q:
View passwords_controller.rb
# app/controllers/custom_devise/password_controller.rb
class CustomDevise::PasswordsController < Devise::PasswordsController
def resource_params
params.require(resource_name).permit(:email, :password, :password_confirmation)
private :resource_params
View passwords_controller.rb
# app/controllers/users/password_controller.rb
class Users::PasswordsController < Devise::PasswordsController
def resource_params
params.require(:user).permit(:email, :password, :password_confirmation)
private :resource_params
sixtenbe /
Last active Oct 1, 2021 — forked from endolith/peakdet.m
Peak detection in Python
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See