Skip to content

Instantly share code, notes, and snippets.

View StanAngeloff's full-sized avatar

Stan Angeloff StanAngeloff

View GitHub Profile
@StanAngeloff
StanAngeloff / define.js
Created October 11, 2012 06:47
Dead simple AMD in a single file.
/**
* Define a module with optional dependencies.
*
* @function
* @param {String} id Optional module ID. If this is omitted, no module is defined and instead <code>factory</code> is called immediately.
* @param {Array} dependencies Optional list of module IDs on which this module depends.
* @param {Function} factory The module body. The function is called with arguments matching the given dependencies, if any.
* @return {Function} The module body with dependencies injected.
*/
var define = (function() {
@StanAngeloff
StanAngeloff / pyannote.ipynb
Last active November 7, 2023 13:53
x-pyannote.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@StanAngeloff
StanAngeloff / simple-imagediff.py
Created February 1, 2012 11:45
Simple Image Diff for Git
#!/usr/bin/env python
# Simple Image Diffs
# ==================
#
# How to Install
# --------------
#
# Download the script somewhere on $PATH as 'simple-imagediff' with +x:
#
@StanAngeloff
StanAngeloff / Makefile
Last active October 11, 2022 19:37
Generate RabbitMQ self-signed certificate authority, server and client certificates.
# See http://www.rabbitmq.com/ssl.html
#
# (c) Stan Angeloff / http://www.gnu.org/licenses/agpl-3.0.html
SHELL := /bin/bash
HOSTNAME ?= $(shell hostname)
PASSPHRASE ?= $(shell cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
PASSPHRASE_FILE = $(HOSTNAME)/.passphrase
@StanAngeloff
StanAngeloff / config.rb
Created July 23, 2012 16:27
Draft PHP script to join @media queries in a CSS file.
# [..]
require 'shellwords'
on_stylesheet_saved do |filename|
script = File.dirname(__FILE__) + '/_scripts/join-media-queries.php'
system('php -q ' + Shellwords.escape(script) + ' -i ' + Shellwords.escape(filename))
end
@StanAngeloff
StanAngeloff / mintty.ahk
Created September 11, 2010 20:27
MinTTY at your fingertips
; AutoHotkey script, download from:
; http://www.autohotkey.com/
; NOTE: Save this file with Windows line endings i.e. \r\n
;
cmd_line := "C:\bin\cygwin\bin\mintty.exe /bin/zsh --login"
wnd_class := "ahk_class mintty"
#c::
@StanAngeloff
StanAngeloff / add-space-to-extent_test_chars.patch
Last active April 9, 2020 12:44
rxvt-unicode 9.22 patches
Add space to extent_test_chars to have FontAwesome being recognized.
Fixes:
$ urxvt -fn "xft:FontAwesome"
urxvt: unable to calculate font width for 'FontAwesome:minspace=True', ignoring.
urxvt: unable to load base fontset, please specify a valid one using -fn, aborting.
Posted to upstream mailinglist:
@StanAngeloff
StanAngeloff / СЛП.sh
Last active January 30, 2019 13:50
Фибанк: СЛП (Лихвен процент, базиран на спестяванията) от терминала
#!/bin/sh
curl -sSL 'https://www.fibank.bg/bg/jilishten-kredit-pravo-na-izbor/page/3467' | \
pup -p '#AIRResults json{}' | \
jq '. as $page | $page | ( [ .[].children[] | select(has("children")) ] | map(.["children"][]["text"]) ) as $list | ( $list | [ range(0; $list | length; 2) | { ($list[.]): $list[(. + 1)] } ] | add ) as $currencies | [{ ($page[0].children[0].text): ($page[0].children[1].text) }, $currencies] | add'
@StanAngeloff
StanAngeloff / git-extract.sh
Created November 5, 2010 19:57
Get those changed files out of Git
#!/bin/bash
BOLD="\033[1m"
_BOLD="\033[22m"
RED="\033[31m"
YELLOW="\033[33m"
GREEN="\033[32m"
RESET="\033[39m"
range=$1
const curry = (fx) => {
const arity = fx.length;
return function f1(...args) {
return args.length >= arity ? fx.apply(null, args) : function f2(...args2) {
return f1.apply(null, args.concat(args2));
};
};
};