Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐧 🗡️ 💻

Milan Thapa thapakazi

💭
🐧 🗡️ 💻
View GitHub Profile
View likes_dislikes.org

What I like and dislike

like

  • childrens playing the game of life
  • hands planting trees, cleaning rivers
  • minds that stick to a business with motivations greater than self, wealth
  • who put other first to themselves
  • all the helpers, blessing, prayers, love, hopes
@thapakazi
thapakazi / app.go
Last active Mar 12, 2019
dump http reqeust headers with a middleware
View app.go
import (
"net/http/httputil"
)
//dump http reqeust headers
func App() *buffalo.App {
if app == nil {
...
//somewhere inside your
if ENV == "development" {
app.Use(middleware.ParameterLogger)
@thapakazi
thapakazi / curl.md
Created Aug 14, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View gist:6556642b392448d9d01268ffd0f6c0b3
(defun source (filename)
"Update environment variables from a shell source file."
(interactive "fSource file: ")
(message "Sourcing environment from `%s'..." filename)
(with-temp-buffer
(shell-command (format "diff -u <(true; export) <(source %s; export)" filename) '(4))
(let ((envvar-re "declare -x \\([^=]+\\)=\\(.*\\)$"))
@thapakazi
thapakazi / helloworld.sol
Last active May 22, 2018
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
View helloworld.sol
pragma solidity ^0.4.4;
contract HelloWorld {
address private creator;
address private lastCaller;
string private message;
uint private totalGas;
constructor() {
@thapakazi
thapakazi / ecdsa_example.rb
Created May 19, 2018 — forked from ostinelli/ecdsa_example.rb
ECDSA usage from Ruby.
View ecdsa_example.rb
require 'openssl'
require 'base64'
# ===== \/ sign =====
# generate keys
key = OpenSSL::PKey::EC.new("secp256k1")
key.generate_key
public_key = key.public_key
public_key_hex = public_key.to_bn.to_s(16).downcase # public key in hex format
@thapakazi
thapakazi / ecc.rb
Created May 19, 2018 — forked from bkerley/ecc.rb
ruby ECDSA fun time
View ecc.rb
# derived from http://h2np.net/tips/wiki/index.php?RubyOpenSSLDigitalSignatureSample
require 'openssl'
require 'base64'
include OpenSSL
group_name = 'secp521r1'
message = '10000 fartbux sent to bryce from a can of beans'
key = PKey::EC.new(group_name)
key = key.generate_key
View golang_version_managers.txt
gimme: https://github.com/travis-ci/gimme/
You can’t perform that action at this time.