Skip to content

Instantly share code, notes, and snippets.

@hoangnh228
hoangnh228 / AuthyToOtherAuthenticator.md
Created September 5, 2021 15:26 — 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 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 guess is that Brian used the

@hoangnh228
hoangnh228 / get_combinations.php
Created October 19, 2019 09:35 — forked from cecilemuller/get_combinations.php
PHP: Get all combinations of multiple arrays (preserves keys)
<?php
function get_combinations($arrays) {
$result = array(array());
foreach ($arrays as $property => $property_values) {
$tmp = array();
foreach ($result as $result_item) {
foreach ($property_values as $property_value) {
$tmp[] = array_merge($result_item, array($property => $property_value));
}
@hoangnh228
hoangnh228 / gist:bc82fa4b74e10409625dfd14bf0e88ed
Created March 7, 2019 03:44 — forked from JesseObrien/gist:7418983
Bind parameters into the SQL query for Laravel ORM
<?php
class MyModel extends Eloquent {
public function getSql()
{
$builder = $this->getBuilder();
$sql = $builder->toSql();
foreach($builder->getBindings() as $binding)
{
@hoangnh228
hoangnh228 / nginx+php+mysql_osx.md
Created November 22, 2016 08:58 — forked from laptrinhcomvn/nginx+php+mysql_osx.md
Set up on Mac OS X El Capitan: Nginx - PHP 5.6.x

Mac OS X El Capitan setup Nginx - PHP 5.6.x, MySQL 5.7.x, phpMyAdmin

1. Install homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@hoangnh228
hoangnh228 / iterm2.md
Last active November 23, 2016 02:25
iterm2 cheatsheet

Shell Intergration (require enable Shell Intergration)

Function Shortcut
Show/hide commands history + B
Show/hide recent directories + Option + /

Tabs and Windows

Function | Shortcut

@hoangnh228
hoangnh228 / Install Composer using MAMP's PHP.md
Created October 26, 2016 02:28 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@hoangnh228
hoangnh228 / 01_Laravel 5 Simple ACL manager_Readme.md
Created October 1, 2015 16:50 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php