Skip to content

Instantly share code, notes, and snippets.


Nick Kapliev nkapliev

View GitHub Profile
gafiatulin / Bech32.scala
Last active Aug 26, 2017
Scala implementation of Bech32 — general checksummed base32 format.
View Bech32.scala
import scala.util.Try
// BIP173
case object Bech32 {
type Int5 = Byte
final val CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
final val CHARSET_MAP: Map[Char, Int5] = CHARSET.zipWithIndex.toMap.mapValues(_.toByte)
final val CHARSET_REVERSE_MAP: Map[Int5, Char] =
justinph / nightmare.js
Created Feb 3, 2017
Webpage performance testing with nightmare.js - solo
View nightmare.js
let Nightmare = require('nightmare');
let harPlugin = require('nightmare-har-plugin');
let options = {
waitTimeout: 1000
let nightmare = Nightmare(Object.assign(harPlugin.getDevtoolsOptions(), options));
nrollr /
Created Mar 29, 2016
Install Redis via Homebrew
brew install redis # Install Redis using Homebrew
ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents # Enable Redis autostart
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist # Start Redis server via launchctl
# homebrew.mxcl.redis.plist contains reference to redis.conf file location: /usr/local/etc/redis.conf
redis-server /usr/local/etc/redis.conf # Start Redis server using configuration file, Ctrl+C to stop
redis-cli ping # Check if the Redis server is running
View sequencehunt_server.js
#!/usr/bin/env node
// run with: node sequencehunt_server.js
// info page: http://localhost:8080/info
// correct values: http://localhost:8080/check?val0=4&val1=12&val2=77&val3=98&val4=35
var http = require('http');
var url = require('url');
var TimingAttackProtectionSeconds = 3;
pavel-odintsov /
Last active Feb 21, 2021 for habrahabr
INTERVAL="1" # update interval in seconds
if [ -z "$1" ]; then
echo usage: $0 [network-interface]
echo e.g. $0 eth0
jacquerie /
Last active Nov 29, 2021
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
cvrebert /
Last active Jan 4, 2022
Survey of screenshot-based CSS testing tools

Currently considering

Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
lsd / IdeaVim OS X Key Repeat.markdown
Last active May 16, 2022
Enable key-repeat for ALL applications or just for IdeaVim/specific JetBrains apps
View IdeaVim OS X Key Repeat.markdown

Upgrading to Lion or Yosemite and WebStorm 9, I noticed key repeat was
turned off for the IdeaVim plugin h j k l keys.

System-wide key repeat

defaults write -g ApplePressAndHoldEnabled -bool false in a terminal will enable
key repeat for every app. This can alternatively be found in the accessibility settings in OS X' preferences.

App specific key repeat

jvns / Makefile
Created Oct 8, 2013
A simple kernel module that printk's "Hello, packet" when it intercepts a packet. Uses netfilter.
View Makefile
obj-m += hello-packet.o
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
dergachev /
Last active May 17, 2022
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application: