Skip to content

Instantly share code, notes, and snippets.

View tsoe77's full-sized avatar
☁️

Thiha Soe tsoe77

☁️
View GitHub Profile
@tsoe77
tsoe77 / dotenv2json.py
Created March 27, 2023 18:38
a script to convert any dot env file to json and vice versa
import json
import sys
import os
def dotenv_to_json(dotenv_path, json_path):
with open(dotenv_path) as f:
data = f.readlines()
result = {}
for line in data:
@bgdnlp
bgdnlp / cognito-test.py
Last active October 11, 2024 16:44
Sign up and log in to Cognito, check tokens, then call an API. Details: https://www.neant.ro/aws/working-with-cognito-and-api-gateway-in-python.html
#!/usr/bin/env python3
# Demonstrates the use of Python to work with Cognito.
# Create a new a user, log in, check tokens and call an API.
# The purpose was to learn about Cognito. Security has been
# circumvented in the interest of keeping it simple.
# Notably, the authentication procedure uses the most insecure
# method. This code is not intended for use in production.
#
# https://www.neant.ro/aws/working-with-cognito-and-api-gateway-in-python.html
@gdbate
gdbate / vue-customizing-amplify-authentication-vuex-module.js
Last active September 27, 2021 19:35
Vue: Customizing Amplify Authentication - Vuex Module
// Dependencies ===============
import {Auth} from 'aws-amplify'
const store = {namespaced: true}
// State ======================
store.state = {
authorized: false,
@mariozig
mariozig / migrate_repo.sh
Last active September 16, 2024 18:48
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active November 24, 2025 10:54
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream