Skip to content

Instantly share code, notes, and snippets.

Tatsh

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
View build-retroarch-ios.sh
#!/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 https://github.com/libretro/RetroArch.git retroarch
fi
@Tatsh
Tatsh / ldmacclientuninstall.sh
Created Mar 29, 2019 — forked from ferment/ldmacclientuninstall.sh
Remove LANDESK from OSX / macOS
View ldmacclientuninstall.sh
#!/bin/sh
#
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
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 https://gist.github.com/Tatsh/d1b5a039d6f511c95a08daade8b07a81
// @namespace https://tat.sh
// @version 0.0.5
// @description Hide the Discover section in >= 1012px view.
// @author Tatsh
// @match https://github.com
// @grant none
// @run-at document-end
@Tatsh
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
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) => Array.prototype.sort.call(a, (a, b) => a - b);
const tail = (n, a) => Array.prototype.slice.call(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
Tatsh / quassel-format.py
Created Jun 25, 2018
Use new Python template syntax to format text in Quassel.
View quassel-format.py
#!/usr/bin/env python
from argparse import Namespace
from string import Template
import sys
Codes = Namespace(
Bold=chr(2),
Color=chr(3),
Normal=chr(15),
Underline=chr(31),
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]))
@Tatsh
Tatsh / delall-icloud-photos.py
Last active Aug 24, 2019
Use pyicloud to delete all photos from iCloud (may need to be run multiple times)
View delall-icloud-photos.py
#!/usr/bin/env python
from __future__ import print_function
import json
import sys
from authentication import authenticate
from future.moves.urllib.parse import urlencode
if __name__ == '__main__':
username = sys.argv[1]
@Tatsh
Tatsh / switch_romfs.py
Created Jul 29, 2017 — forked from SciresM/switch_romfs.py
Switch RomFS (IStorage) -> Files
View switch_romfs.py
from struct import unpack as up
import sys, os
dirs, files = None, None
def read_at(fp, off, len):
fp.seek(off)
return fp.read(len)
def read_u8(fp, off):
@Tatsh
Tatsh / functions.php
Last active Nov 11, 2017
Roman numeral parsers
View functions.php
<?php
namespace RomanNumeralParser;
function parse(string $s): int
{
static $map;
if (!$map) {
$map = [
'I' => 1,
'V' => 5,
'X' => 10,
You can’t perform that action at this time.