Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block Tatsh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
Tatsh /
Last active Feb 3, 2020
Start of a Pylint plugin to check for lists that have never been mutated, and could therefore be a tuple or other immutable type.
from typing import Dict, List, Optional, Union
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from pylint.lint import PyLinter
import astroid
from astroid.scoped_nodes import FunctionDef
Tatsh /
Last active Jan 23, 2020
Automate transferring of repositories from one user to another.

How to use

  1. Change OLD_USER to the current owner of the repositories to transfer.
  2. Change NEW_USER to the new owner.
  3. Change REPOS to be an iterable of repository names (str) to transfer.
  4. Transfer one repository normally through the web browser, because you need to type your password once (this only lasts for a few hours).
  5. Extract cookies from the browser after signing into GitHub. Save in Netscape format in cookies.txt in the same location as the script. On every line in cookies.txt that starts with '' change it to ''.
  6. python because the API does not have this feature!

You can extract cookies from Chrome in Netscape format with EditThisCookie.

Tatsh / fibseq.spl
Created Dec 7, 2019
Maybe working fibonacci algorithm in Shakespeare language.
View fibseq.spl
Fibonacci Sequence.
Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ghost, another character.
Ophelia, flatterer.
Act I: The one.
Scene I: Zero.
#!/usr/bin/env bash
set -e
SIGNING_IDENTITY='iPhone Distribution: Andrew Udvare (EU5R2QY9HJ)'
mkdir -p ~/dev/retroarch
cd ~/dev/retroarch
if ! [ -d retroarch ]; then
git clone retroarch
Tatsh /
Created Mar 29, 2019 — forked from ferment/
Remove LANDESK from OSX / macOS
function killAllProcs( )
sudo /usr/bin/killall $1
/bin/ps ax | /usr/bin/grep $1|/usr/bin/awk '{print $1}'|/usr/bin/xargs sudo kill -9
echo "removing LANDesk Client"
Tatsh / github-no-discover.user.js
Last active Mar 28, 2019
Hide the Discover section in >= 1012px view
View github-no-discover.user.js
// ==UserScript==
// @name No Discover
// @homepage
// @namespace
// @version 0.0.5
// @description Hide the Discover section in >= 1012px view.
// @author Tatsh
// @match
// @grant none
// @run-at document-end
Tatsh / qsort.js
Last active Dec 3, 2018
Single-expression qsort() implementations
View qsort.js
const sorted = xs => xs.length <= 1 ? xs : sorted(xs.slice(1).filter(x => x < xs[0])).concat([xs[0]], sorted(xs.slice(1).filter(x => x > xs[0])))
Tatsh / smallest-in-array-positive.js
Last active Jul 28, 2018
Demo test question on Codility.
View smallest-in-array-positive.js
const sorted = (a) =>, (a, b) => a - b);
const tail = (n, a) =>, n);
const abs = Math.abs;
const solution = (a) => {
const sa = sorted(a);
let last = abs(a[0]);
for (const x of tail(1, sa)) {
const negative = x < 0;
Tatsh /
Created Jun 25, 2018
Use new Python template syntax to format text in Quassel.
#!/usr/bin/env python
from argparse import Namespace
from string import Template
import sys
Codes = Namespace(
View padStart.js
import {
append, compose, curryN, join, length, partialRight, prepend, repeat, subtract,
} from 'ramda'
const pad = (str, n, char = ' ', _f = append) => compose(join(''), _f(str), repeat(char), subtract(n), length)(str)
const padStart = curryN(3, pad)
const padEnd = curryN(3, partialRight(pad, [prepend]))
You can’t perform that action at this time.