Skip to content

Instantly share code, notes, and snippets.

NightMachinary

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
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
topic.click()
View ds_mic.py
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)')
View principled-meta-programming.md

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
Piasy / install_ffmpeg.sh
Last active Sep 29, 2019
brew install ffmpeg with all options
View install_ffmpeg.sh
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@pesterhazy
pesterhazy / ripgrep-in-emacs.md
Last active Oct 13, 2019
Using ripgrep in Emacs using helm-ag (Spacemacs)
View ripgrep-in-emacs.md

Why

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.

How

@trevorbernard
trevorbernard / Security.java
Created Jun 30, 2017
JeroMQ Curve Security
View Security.java
import org.zeromq.ZContext;
import org.zeromq.ZMQ;
import org.zeromq.ZMQ.Socket;
import zmq.io.mechanism.curve.Curve;
public class Security {
public static void main(String[] args) throws Exception {
Curve curve = new Curve();
String[] serverKeys = curve.keypairZ85();
@magnetikonline
magnetikonline / README.md
Last active Feb 25, 2019
Bash internal field separator (IFS) usage.
View README.md

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 ifs.sh, comparing the difference between the default and setting only newline as a boundary we get the following output:

/path/to/first
file
/path/to/second
file
/path/to/third
@avih
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) https://github.com/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
nkentaro / urlcodec.py
Created Jan 16, 2017
url encode and decode in python3
View urlcodec.py
import urllib.parse
def urlencode(str):
return urllib.parse.quote(str)
def urldecode(str):
return urllib.parse.unquote(str)
str = '{"name": "Kinkin"}'
@Halolegend94
Halolegend94 / texToKindle.sh
Created Jan 15, 2017
Convert a tex file to an ebook for Kindle
View texToKindle.sh
#!/bin/bash
# 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)
currdir=`pwd`
You can’t perform that action at this time.