Skip to content

Instantly share code, notes, and snippets.

View nemesisqp's full-sized avatar

NĐQP nemesisqp

  • Vietnam
View GitHub Profile
@nemesisqp
nemesisqp / lpeg_unicode.lua
Created June 17, 2012 15:33 — forked from daurnimator/lpeg_unicode.lua
Adding UTF8 support for lpeg
local lpeg = require "lpeg"
local utf8_codepoint
do
-- decode a two-byte UTF-8 sequence
local function f2 (s)
local c1, c2 = string.byte(s, 1, 2)
return c1 * 64 + c2 - 12416
end
@nemesisqp
nemesisqp / mvm.lua
Last active August 29, 2015 14:08 — forked from usysrc/mvm.lua
local MEM = {}
local PC = 0
local registers = {
A = 0,
B = 0,
C = 0,
D = 0
}
local fetch = function()
@nemesisqp
nemesisqp / helper.js
Created February 14, 2017 04:46
handlebars compareTime helper
Handlebars.registerHelper('compareTime', function(lhs, operator, rhs, options) {
/*eslint eqeqeq: 0*/
if (arguments.length < 4) {
throw new Error('handlebars Helper {{compareTime}} expects 4 arguments');
}
var a = rhs, b = rhs;
if (!moment.isMoment(a)) a = moment(lhs);
if (!moment.isMoment(b)) b = moment(rhs);
#!/usr/bin/env bash
{ # this ensures the entire script is downloaded #
nvm_has() {
type "$1" > /dev/null 2>&1
}
nvm_install_dir() {
printf %s "${NVM_DIR:-"$HOME/.nvm"}"
! function(a, b) {
"object" == typeof exports && "object" == typeof module ? module.exports = b() : "function" == typeof define && define.amd ? define([], b) : "object" == typeof exports ? exports.jwplayer = b() : a.jwplayer = b()
}(this, function() {
return function(a) {
function b(c) {
if (d[c]) return d[c].exports;
var e = d[c] = {
exports: {},
id: c,
loaded: !1
'use strict';
const PROD = !!(require('yargs').argv.production);
console.log(PROD ? 'production' : 'dev', 'mode');
let site = require('./site');
const gulp = require('gulp');
let browser;
const Metalsmith = require('metalsmith');
const Handlebars = require('handlebars');
@nemesisqp
nemesisqp / init.sh
Created December 3, 2017 08:35
script-ea-bash
#!/bin/bash
settingFile=setting.conf
logFile=result
. $settingFile
fullGitHttpUrl="${gitHttpUrl:0:8}$username:$password@${gitHttpUrl:8}"
repoNameWithDotGit=`basename "$fullGitHttpUrl"`
repoName="${repoNameWithDotGit:0:-4}"
@nemesisqp
nemesisqp / c#.txt
Last active January 24, 2019 07:42
Programming Language Common Words
summary System using public return this the if new param string name null int get to void value var set false of private true assembly else The is returns for object static in bool Windows Assert override class case Collections break namespace global type throw result endregion Generic using Name and remarks Add resource Forms const try para Text or Linq an Test region code catch Microsoft Runtime that default aapt java cref be from base with not internal protected Type Length file by exception as see Data values Exception Version typeof following ComponentModel byte ToString ex String item Diagnostics generated Fact Web Drawing Value index can source context method Threading This data Count foreach ComVisible on COM List Dispose you out AreEqual virtual message reader information Create readonly endif If attribute double Serialization Console field AccessFlags Dot42 Controls DexImport Xml request IO node key Build ArgumentNullException sender id text modify list Tasks float obj instance Equal Reflection Wri
@nemesisqp
nemesisqp / encode.sh
Created April 25, 2019 00:01 — forked from jeffpamer/encode.sh
Smooth Scrubbing Web Video FFMPEG Mega Command
ffmpeg -i input.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -an -vf "scale=-1:1440, reverse" -preset veryslow -g 2 output.mp4
// -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3
// Encode for web with a good balance of browser compatibility and compression ratio
// -an
// Strip audio tracks
// -vf "scale=-1:1440, reverse"
// Scale video to 1440px wide, maintaining aspect ratio
@nemesisqp
nemesisqp / AuthyToOtherAuthenticator.md
Created April 25, 2019 05:44 — 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