Skip to content

Instantly share code, notes, and snippets.

View v9n's full-sized avatar
🛫
forward email at mailwip.com

Vinh v9n

🛫
forward email at mailwip.com
View GitHub Profile
@v9n
v9n / esbuild.js
Created October 14, 2021 17:59
Esbuild with devserber and scss
const esbuild = require('esbuild');
const sassPlugin = require('esbuild-plugin-sass')
const http = require('http');
let publicURL = "/"
let nodeEnv = "development"
const buildOptions = {
entryPoints: ['src/index.jsx'],
bundle: true,
@v9n
v9n / Gemfile
Created April 21, 2021 06:11 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@v9n
v9n / index.js
Created April 11, 2021 00:29
hanami webhook demo
const express = require('express');
const app = express();
const port = 4443;
app.use(express.json()); //Used to parse JSON bodies
// HANAMI added this
app.use(express.urlencoded({extended:false})); //Parse URL-encoded bodies
app.get('/', (req, res) => {
require 'csv'
require "base64"
require 'json'
table = CSV.read("lastpass_export.csv", headers: true)
# export BW_SESSION="Run `bw login` to get this"
folders = []
table.each do |row|
thay cai nay
```
<link rel=“canonical” href=“{{ .Permalink }}“>
```
thanh
```
{{ $pag := .Paginate .Data.Pages }}
@v9n
v9n / AuthyToOtherAuthenticator.md
Created March 13, 2020 21:07 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes (beware, through Google) for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My gues

@v9n
v9n / README.txt
Last active December 19, 2019 21:02 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh [email protected]
Run the server in one terminal
go run server.go
@v9n
v9n / tls-client.go
Created December 19, 2019 21:01 — forked from michaljemala/tls-client.go
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
@v9n
v9n / gist:9aa228db5a809ba7273230dae7ed6265
Created February 28, 2019 09:26 — forked from telent/gist:9742059
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java
@v9n
v9n / list-deps.cr
Created December 22, 2018 09:10 — forked from bcardiff/list-deps.cr
List binary dependencies to build a minimal docker image from scratch
unless ARGV.size > 0
puts " Missing executable file argument"
puts " Usage (in a Dockerfile)"
puts " RUN crystal run ./path/to/list-deps.cr -- ./bin/executable"
exit 1
end
executable = File.expand_path(ARGV[0])
unless File.exists?(executable)