Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block NightMachinary

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
bgopikrishna / quoraTopicsUnfollow.js
Created Jan 1, 2019
A script to unfollow all topics in Quora at a time
View quoraTopicsUnfollow.js
//Wait for the topics to load
//Then execute the script
//Get all following Topics
const topicsFollowing = document.querySelectorAll('.ObjectCard-footer a')
function unFollowAll() {
topicsFollowing.forEach(topic => {
//clicking unFollow button
import argparse
import deepspeech as ds
import numpy as np
import shlex
import subprocess
import sys
parser = argparse.ArgumentParser(description='DeepSpeech speech-to-text from microphone')
parser.add_argument('--model', required=True,
help='Path to the model (protocol buffer binary file)')

Principled Meta Programming for Scala

This note outlines a principled way to meta-programming in Scala. It tries to combine the best ideas from LMS and Scala macros in a minimalistic design.

  • LMS: Types matter. Inputs, outputs and transformations should all be statically typed.

  • Macros: Quotations are ultimately more easy to deal with than implicit-based type-lifting

  • LMS: Some of the most interesting and powerful applications of meta-programming

Piasy /
Last active Feb 8, 2020
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
pesterhazy /
Last active Feb 3, 2020
Using ripgrep in Emacs using helm-ag (Spacemacs)


Ripgrep is a fast search tool like grep. It's mostly a drop-in replacement for ag, also know as the Silver Searcher.

helm-ag is a fantastic package for Emacs that allows you to display search results in a buffer. You can also jump to locations of matches. Despite the name, helm-ag works with ripgrep (rg) as well as with ag.


trevorbernard /
Created Jun 30, 2017
JeroMQ Curve Security
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMQ.Socket;
public class Security {
public static void main(String[] args) throws Exception {
Curve curve = new Curve();
String[] serverKeys = curve.keypairZ85();
magnetikonline /
Last active Nov 4, 2019
Bash internal field separator (IFS) usage.

Bash internal field separator (IFS) usage

The IFS internal variable is used to determine what characters Bash defines as word/item boundaries when processing character strings. By default set to whitespace characters of space, tab, and newline.

Running the example, comparing the difference between the default and setting only newline as a boundary we get the following output:

avih / context.lua
Created Feb 2, 2017
flexible mpv context menu using Tcl/Tk, for Windows too!
View context.lua
--[[ *************************************************************
* Context menu for mpv using Tcl/Tk. Mostly proof of concept.
* Avi Halachmi (:avih)
* Features:
* - Simple construction: ["<some text>", "<mpv-command>"] is a complete menu item.
* - Possibly dynamic menu items and commands, disabled items, separators.
* - Possibly keeping the menu open after clicking an item (via re-launch).
* - Hacky pseudo sub menus. Really, this is an ugly hack.
* - Reasonably well behaved/integrated considering it's an external application.
nkentaro /
Created Jan 16, 2017
url encode and decode in python3
import urllib.parse
def urlencode(str):
return urllib.parse.quote(str)
def urldecode(str):
return urllib.parse.unquote(str)
str = '{"name": "Kinkin"}'
Halolegend94 /
Created Jan 15, 2017
Convert a tex file to an ebook for Kindle
# This script converts a tex source to azw3 format using htlatex and ebook-convert (from calibre)
# to set the resolution of math images edit this file
# sudo gedit /usr/share/texmf/tex4ht/tex4ht.env
# in the section <dvipng> modify the DPI parameter (-D) of the two commands (I use 100)
# do the operation in a temporary directory. htlatex produces a lot of files (and we can't set an output dir)
You can’t perform that action at this time.