Skip to content

Instantly share code, notes, and snippets.

View Draccano's full-sized avatar
🐲

Adam Richter Draccano

🐲
  • Brno, Czech Republic
View GitHub Profile
@rjz
rjz / crypto-aes-256-gcm-demo.js
Last active March 28, 2026 22:39
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// The `iv` for a given key must be globally unique to prevent
@danrovito
danrovito / countrydropdown.html
Last active April 12, 2026 21:11
HTML Country Select Dropdown List
<label for="country">Country</label><span style="color: red !important; display: inline; float: none;">*</span>
<select id="country" name="country" class="form-control">
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
@mandiwise
mandiwise / Update remote repo
Last active April 20, 2026 05:58
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@EyalAr
EyalAr / batch_export.sh
Last active October 3, 2023 01:55
Shell script to easily export mongo collections into JSON files
#!/usr/bin/env bash
#https://gist.github.com/EyalAr/67791f51fce51ed55594
COLLECTIONS=()
HOST="127.0.0.1"
PORT="27017"
DB=
if [ -n "$1" -a "$1" = "--help" ]