Skip to content

Instantly share code, notes, and snippets.

View m24927605's full-sized avatar

Michael m24927605

  • Taiwan,Taipei
View GitHub Profile
@montanaflynn
montanaflynn / pget.go
Last active January 17, 2025 17:07
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index
@MrChrisJ
MrChrisJ / bitcoin.conf
Last active February 13, 2019 06:44
20160106-Bitcoin.conf
### bitcoin.conf configuration file. Lines beginning with # are comments.
### Uncomment and edit options you wish to use.
## JSON-RPC options (for controlling a running bitcoin-qt/bitcoind process)
# server=1 tells Bitcoin to accept JSON-RPC commands.
server=1
# Use this for Bitcoin core for development and blockchain analysis
# txindex=1
@mykiimike
mykiimike / gist:eae214a32f81c144950e
Created June 10, 2015 14:33
Nodejs crypto good practice AES-CBC + SHA256 + HMAC
// var cryptoKey = raw SHA256 Hash
function decypherPayload(payload) {
/* inputs */
var t = payload.split(",");
var C = t[0],
IV = t[1],
Hm = t[2];
@endorama
endorama / angular-loadscript.js
Last active October 11, 2018 07:28
AngularJS 1.2.0 lazy load script in partials
/*
* Angular LoadScript
*
* Let angular load and execute lazy javascript from partials!
*
* This module is the result of this issue: "1.2.0rc1 regression: script tags not loaded via ngInclude"
* Issue url: https://github.com/angular/angular.js/issues/3756
*
* As of Angular 1.2.0 the ngInclude scripts does not permit execution of javascript from included partials.
* This little module execute code inside script tags with "javascript-lazy" attribute after partial loading,
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active April 14, 2025 11:07
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh