Skip to content

Instantly share code, notes, and snippets.

View johnteee's full-sized avatar

John Lee johnteee

  • Taipei
View GitHub Profile
@ygotthilf
ygotthilf / jwtRS256.sh
Last active August 31, 2026 22:25
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@LinZap
LinZap / name_generator_crawler.js
Created September 7, 2015 07:16
姓名產生器爬蟲 (payload)
var http = require('http');
var fs = require('fs');
var iconv = require('iconv-lite');
var querystring = require('querystring');
var BufferHelper = require('bufferhelper');
// var url = "http://www.richyli.com/name/index.asp";
var params = {
name_count:1000,
"break":2,
@harlow
harlow / golang_job_queue.md
Last active May 30, 2026 04:28
Job queues in Golang
@pjdietz
pjdietz / rfc3339.js
Last active May 27, 2024 12:25
Format a local date as an RFC 3339 date with timezone
function rfc3339(d) {
function pad(n) {
return n < 10 ? "0" + n : n;
}
function timezoneOffset(offset) {
var sign;
if (offset === 0) {
return "Z";
@asserchiu
asserchiu / score_a_word.py
Created May 21, 2015 10:08
Score a word with a: 1, b: 2, ..., z: 26.
#!/usr/bin/python
# -*- coding: utf-8 -*-
def score_a_word(word=''):
# TODO: add exception!
sum = 0
for char in word.lower():
sum += (ord(char) - 96)
print(word + ' for ' + str(sum))
@uzegonemad
uzegonemad / laravel-5-strip-x-requested-for-header.php
Created April 14, 2015 14:38
Laravel 5 Middleware - Strip X-Requested-For Header
<?php namespace App\Http\Middleware;
use Closure;
class StripHeaders {
/**
* Strip X-Requested-With from the request because we're handling
* all json output and don't want interference from Laravel.
*
@lukrizal
lukrizal / inkscape.sh
Last active April 11, 2017 06:49
Install Inkscape CentOS 6.6
#!/usr/bin/env bash
# Make installation directory
mkdir -p ~/install/inkscape && cd ~/install/inkscape && \
# Install necessary packages
sudo yum -y install bzr && bzr branch lp:inkscape && \
sudo yum -y groupinstall "Development Tools" && \
sudo yum -y install ImageMagick-c++-devel ImageMagick-c++ ImageMagick-devel ImageMagick glibmm24-devel libsigc++-devel gtkmm24-devel glibmm24 libsigc++ gtkmm24 intltool gc gc-devel lcms lcms-devel gsl gsl-devel libxml2-devel libxslt-devel boost-devel popt-static poppler-devel inkscape && \
@lee8oi
lee8oi / startProcess.go
Last active January 9, 2025 15:31
Using os.StartProcess() in Go for platform-independent system command execution.
package main
import (
"os"
"os/exec"
)
func Start(args ...string) (p *os.Process, err error) {
if args[0], err = exec.LookPath(args[0]); err == nil {
var procAttr os.ProcAttr
/*
Do not modify this version of the file. It will be copied over when any of the project's targets are built.
If you wish to modify mraid.js, modify the version located at mopub-sdk-common/mraid/mraid.js.
*/
(function() {
var isIOS = (/iphone|ipad|ipod/i).test(window.navigator.userAgent.toLowerCase());
if (isIOS) {
console = {};
console.log = function(log) {
var iframe = document.createElement('iframe');
@boopathi
boopathi / README.md
Last active September 25, 2025 20:45
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,