Skip to content

Instantly share code, notes, and snippets.

View WJWang's full-sized avatar

William Wang(Wei) WJWang

View GitHub Profile
@WJWang
WJWang / QREncrypter.cs
Created August 12, 2019 19:31 — forked from imrehg/QREncrypter.cs
QR code encryption code for Taiwanese electronic invoice
namespace tw.gov.nat.einvoice.qrutil {
using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;
public class QREncrypter {
public string AESEncrypt(string plainText, string AESKey) {
byte[] bytes = Encoding.Default.GetBytes(plainText);
ICryptoTransform transform = new RijndaelManaged { KeySize = 0x80, Key = this.convertHexToByte(AESKey), BlockSize = 0x80, IV = Convert.FromBase64String("Dt8lyToo17X/XkXaQvihuA==") }.CreateEncryptor();
@WJWang
WJWang / multiple_ssh_setting.md
Created April 26, 2018 03:23 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@WJWang
WJWang / headless.md
Created April 14, 2017 04:25 — forked from addyosmani/headless.md
So, you want to run Chrome headless.

Update

If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.

You can use chrome --headless on Linux as of M57 but note you'll need to build the binaries yourself for now.

The metabug for adding headless mode to Chromium is over here.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@WJWang
WJWang / CatchAllOptionsRequestsProvider.php
Created March 3, 2017 03:50 — forked from danharper/CatchAllOptionsRequestsProvider.php
Lumen with CORS and OPTIONS requests
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
/**
* If the incoming request is an OPTIONS request
* we will register a handler for the requested route
*/
class CatchAllOptionsRequestsProvider extends ServiceProvider {
@WJWang
WJWang / TaiwanStreetName
Created March 28, 2016 10:39 — forked from davidou123/TaiwanStreetName
這是一份台灣街道的資料 內容格式為[排序序號][郵遞區號三碼][縣市][鄉鎮市][路名] 資料來源來自於綠奶茶blog整理(http://milkmidi.blogspot.tw/2012/03/blog-post.html) ------------------------------------------------- 而他的資料來源是從中華郵政api撈出來的 http://www.post.gov.tw/post/internet/f_searchzone/streetNameData.jsp (直接點是無效的, 請用任意程式用 POST傳值) city:臺北市 cityarea:信義區 就會得到該區的街道XML
This file has been truncated, but you can view the full file.
-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
--
-- 主機: localhost
-- 建立日期: Mar 12, 2013, 03:16 PM
-- 伺服器版本: 5.0.51
-- PHP 版本: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";