Skip to content

Instantly share code, notes, and snippets.

View ssut's full-sized avatar

Suhun Han ssut

View GitHub Profile
@ssut
ssut / line.thrift
Created February 22, 2014 08:24
Naver LINE protocol interface file, functions as used by the desktop client.
// Naver LINE protocol interface file, functions as used by the desktop client.
namespace cpp line
// :%s/.*"\([^"]*\)", \d\+, \(\d\+\).*/\1 = \2;/
enum TalkExceptionCode {
ILLEGAL_ARGUMENT = 0;
AUTHENTICATION_FAILED = 1;
DB_FAILED = 2;
@ssut
ssut / list.txt
Last active December 11, 2021 05:28
uBlock rules
[Adblock Plus 2.0]
! Title: ssut
! Version: 20211211
! https://www.clien.net
www.clien.net##.main_top_ad
www.clien.net##.main_center_ad
www.clien.net##.list_top_ad
www.clien.net###hongboInfoList
www.clien.net##.list_bottom_ad
@ssut
ssut / Currencies.md
Last active May 25, 2021 08:28 — forked from aaronhayes/Currencies.md
Common Currencies Array JSON
// ==UserScript==
// @name NoReferrer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http*://*/*
// @grant GM_xmlhttpRequest
// @connect coupa.ng
// @connect a.aliexpress.com
@ssut
ssut / benchmark.rb
Created April 15, 2014 13:57
Ruby Object Serialization Performance Test (Native vs OJ Library)
require 'benchmark'
require 'oj'
require 'json'
require 'ostruct'
N_OJ = 500_000
ex_HASH = { 'one' => 1, 'array' => [ true, false ] }
ex_JSON = '{ "one": 1, "array": [ true, false ] }'
@ssut
ssut / download.js
Last active June 17, 2020 02:14
download vscode extensions from settings sync's cloudSettings file
const fs = require('fs');
const { promisify } = require('util');
const child = require('child_process');
const statAsync = promisify(fs.stat);
const unlinkAsync = promisify(fs.unlink);
const UA = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36';
async function main() {
@ssut
ssut / benchmark.py
Last active August 24, 2019 08:54
Python decorator endpoint implementation (like Flask blueprint module) - O(1)
#-*- coding: utf-8 -*-
import time
from collections import namedtuple
from test import ep as app
BenchResult = namedtuple('BenchResult', ['str', 'time'])
def benchmark(str, times=100000):
t_start = time.time()
for i in range(times):
@ssut
ssut / attachment.php
Last active August 2, 2019 09:07 — forked from kijin/attachment.php
UTF-8 file download function, support remote file passing(proxy) with http range header
<?php
/**
* PHP File download function.
* Version 1.4
*
* Copyright (c) 2014 성기진 Kijin Sung
* Modified by ssut
*
* License: MIT License (a.k.a. X11 License)
import * as amqp from 'amqplib';
export class ExponentialBackoffHelper {
private maxDelay: number = 60;
private factor: number = 2;
private maxAttempts: number = 5;
constructor(
@ssut
ssut / dns-over-https.go
Created February 16, 2017 13:48
dnsoverhttps
package main
import (
"encoding/json"
"errors"
"net/url"
fasthttp "github.com/valyala/fasthttp"
)