Skip to content

Instantly share code, notes, and snippets.

View nkapliev's full-sized avatar
🎯
Focusing

Nick Kapliev nkapliev

🎯
Focusing
View GitHub Profile
@gafiatulin
gafiatulin / Bech32.scala
Last active May 29, 2022 15:44
Scala implementation of Bech32 — general checksummed base32 format.
import scala.util.Try
// BIP173
// https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki
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] = CHARSET_MAP.map(_.swap)
@justinph
justinph / nightmare.js
Created February 3, 2017 19:37
Webpage performance testing with nightmare.js - solo
let Nightmare = require('nightmare');
let harPlugin = require('nightmare-har-plugin');
let options = {
waitTimeout: 1000
};
harPlugin.install(Nightmare);
let nightmare = Nightmare(Object.assign(harPlugin.getDevtoolsOptions(), options));
@nrollr
nrollr / Redis.sh
Created March 29, 2016 11:30
Install Redis via Homebrew
#!/bin/bash
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
#!/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
pavel-odintsov / pps.sh
Last active August 27, 2023 20:21
Simple script to print packet rate for interface
#!/bin/bash
# Interval of calculation in seconds
INTERVAL="1"
if [ -z "$1" ]; then
echo
echo usage: $0 [network-interface]
echo
echo e.g. $0 eth0
@jacquerie
jacquerie / foobar.py
Last active October 28, 2023 16:09
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''
@cvrebert
cvrebert / css_regression_testing.md
Last active May 9, 2023 12:13
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


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
lsd / IdeaVim OS X Key Repeat.markdown
Last active May 3, 2024 07:22
Enable key-repeat for ALL applications or just for IdeaVim/specific JetBrains apps

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
jvns / Makefile
Created October 8, 2013 03:24
A simple kernel module that printk's "Hello, packet" when it intercepts a packet. Uses netfilter.
obj-m += hello-packet.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
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

Instructions

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