Skip to content

Instantly share code, notes, and snippets.

View .gitignore-for-truffle
// fork: openzeppelin-contracts
# Logs
# Runtime data
View dev-plugin.php
* @package Dev-Plugin
* @version 1.7.2
Plugin Name: Dev Plugin
Plugin URI:
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
Author: Matt Mullenweg
wahengchang / customPaymentWooCommercePlugin.php
Last active Aug 27, 2021
This is a gist note for myself, and the php plugin is created by Lafif Astahdziq: you can save that code as file and place under wp-content/plugins/
View customPaymentWooCommercePlugin.php
Asked 8 years, 2 months ago
Active 2 months ago
Viewed 28k times
I want to add a New Payment Method in WooCommerce.
wahengchang /
Created Jul 28, 2021
ping multiple IP's using bash, Loop through an array of strings of IP. and save the result to text file, with naming
# Program name:
# Run: source
# put your target list of ip to arr
declare -a arr=("" "")
for ip in "${arr[@]}"
# change 200 to the number of packets that you want
wahengchang /
Last active Jan 8, 2021
curl url call in for loop
for ((i=1;i<=$max;i++)); do curl -v --header "Connection: keep-alive" "$url"; done
wahengchang /
Created Jan 24, 2020
Python script, which convert mov, flv, avi .etc to mp4 format
import subprocess
import os
src = './src'
dst = './mp4'
for root, dirs, filenames in os.walk(src, topdown=False):
for filename in filenames:
print('[INFO] 1',filename)
wahengchang /
Last active Mar 25, 2019

Welcome to the Challenge


Scraping the 1000 data from this site and save it as a json file.

From this site:

Username Password
View fetchMacauNews.js
// example of fetching a
(async function(){
const fetch = require('node-fetch')
const fs = require('fs')
const cheerio = require('cheerio')
const html = await fetch(``).then(res => res.text())
const path = `./temp/${year}-${month}`
wahengchang / nest-file-under-directory.js
Last active Mar 16, 2018
It is a script of printing and counting specific file under directory
View nest-file-under-directory.js
const fs = require('fs');
Array.prototype.remove = function(data) {
const dataIdx = this.indexOf(data)
if(dataIdx >= 0) {
this.splice(dataIdx ,1);
return this.length;