Skip to content

Instantly share code, notes, and snippets.

View diophung's full-sized avatar

Dio Phung diophung

View GitHub Profile
@diophung
diophung / faster_keyboard.sh
Created November 4, 2022 03:09
Increase keyboard repeat rate on Mac
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
@diophung
diophung / runas_mssql.bat
Last active August 6, 2018 23:07
Access MS SQL server on an AD domain using runas (from virtual machine or non-domain computer)
# The path to SSMS.exe depends on your SQL engine version:
# --------------
# 2008 R2: C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe
# 2012 : C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Ssms.exe
# 2014 : C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe
# 2016 : C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe
# Note the quotes
# --------------
# runas /netonly /user:<DOMAIN>\<user> "<path to SSMS>\Ssms.exe -S <SERVER IP or NAME>"
@diophung
diophung / nacl-encryption.py
Created February 14, 2018 13:06 — forked from noqqe/nacl-encryption.py
An example code for pynacl encryption and decryption (Salsa20+poly1305)
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import nacl.secret
import nacl.utils
import base64
from pyblake2 import blake2b
import getpass
@diophung
diophung / MySQL_macOS_Sierra.md
Created September 4, 2017 23:52 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@diophung
diophung / gist:61b870d62f07f76a1a82f42f9e269283
Created March 15, 2017 18:35 — forked from dalethedeveloper/gist:1503252
Mobile Device Detection via User Agent RegEx

#Mobile Device Detection via User Agent RegEx

Yes, it is nearly 2012 and this exercise has been done to death in every imaginable language. For my own purposes I needed to get the majority of non-desktop devices on to a trimmed down, mobile optimized version of a site. I decided to try and chase down an up-to-date RegEx of the simplest thing that could possibly work.

I arrived at my current solution after analyzing 12 months of traffic over 30+ US based entertainment properties (5.8M+ visitors) from Jan - Dec 2011.

The numbers solidified my thoughts on the irrelevancy of including browsers/OSes such as Nokia, Samsung, Maemo, Symbian, Ipaq, Avant, Zino, Bolt, Iris, etc. The brass tacks of the matter is that you certainly could support these obscure beasts, but are you really going to test your site on them? Heck, could you even find one?! Unless the folks that pay you are die hard Treo users my guess is "No".

Interestingly enough my research shows that /Mobile/ is more efficient than **/iP(

@diophung
diophung / frontendDevlopmentBookmarks.md
Created October 11, 2016 16:59 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@diophung
diophung / Changelog
Created August 16, 2016 18:07 — forked from CHEF-KOCH/Changelog
Visual Studio 2015 Update 2
Visual Studio:
Visual Studio Tools for Apache Cordova
Visual Studio Tools for Universal Windows App Development
Visual C++
C# and Visual Basic
.NET Framework 4.6.1
Visual Studio IDE
NuGet
TypeScript