Skip to content

Instantly share code, notes, and snippets.

KoryNunn /
Last active April 26, 2023 07:01
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

hallettj / Makefile
Last active May 3, 2023 18:52
Makefile for transpiling with Babel & Flow in a Node app, or in a client- or server-side shared library
View Makefile
# Makefile for transpiling with Babel in a Node app, or in a client- or
# server-side shared library.
.PHONY: all clean
# Install `babel-cli` in a project to get the transpiler.
babel := node_modules/.bin/babel
# Identify modules to be transpiled by recursively searching the `src/`
# directory.
phlipper / monosnap-s3-iam-policy.json
Created October 5, 2014 22:32
Monosnap Custom S3 Bucket - IAM Policy
View monosnap-s3-iam-policy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "AllowGroupToSeeBucketListInTheConsole",
"Action": [
"Effect": "Allow",
import socket
import struct
def ip2long(ip):
packedIP = socket.inet_aton(ip)
return struct.unpack("!I", packedIP)[0]
# Handshake
message = struct.pack('!qii', 0x41727101980, 0, 1)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
mziwisky /
Last active March 7, 2023 09:16
Oauth2 Explanation


The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

lrvick / angular-socket.js
Created October 18, 2013 15:53
AngularJS service to connect to a websocket server (SockJS or pure WebSocket), manage reconnection, and allow the rest of the angular application to easily send/retrieve data from an open socket.
View angular-socket.js
//TODO: make this a module
* # SockJS socket management service
* Creates SockJS socket connection to server, re-connects on disconnection,
* and exports hooks to map handlers for various data interactions.
grafov / gist:5712165
Created June 5, 2013 07:22
golang sample of json/rpc over websocket
View gist:5712165
package main
import (
View sample-site.conf
upstream some_app_server {
server {
listen 80;
server_name ;
Nurdok /
Last active December 16, 2022 03:45
Python Conversion

Python Number Conversion Chart

From To Expression
kstep /
Created August 29, 2012 18:03
Simple Python HTML template DSL (improved Python 3 version)
# Python Template Markup Language
# Simple Python DSL for HTML and (a little) CSS templating.
# Example:
# from ptml import *
# with html5 as out:
# with head: