Skip to content

Instantly share code, notes, and snippets.

View hzi-dev's full-sized avatar

Phong Dev hzi-dev

View GitHub Profile
@hzi-dev
hzi-dev / .gitconfig
Created December 26, 2018 04:36 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@hzi-dev
hzi-dev / batch.properties
Created September 29, 2019 10:35 — forked from cl4rk3/batch.properties
Batch script to manipulate arbitrary Windows environment variables from the command line
PROJECT_ROOT=C:\development
JAVA_VERSION=1.5.0_11
JAVA_HOME=%PROJECT_ROOT%\java%JAVA_VERSION%
ANT_HOME=%PROJECT_ROOT%\tools\apache-ant-1.8.1
PATH=%JAVA_HOME%/bin;%PATH%;%ANT_HOME%/bin;

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

@hzi-dev
hzi-dev / resources.md
Created January 10, 2020 17:13 — forked from UltCombo/resources.md
JavaScript resources
@hzi-dev
hzi-dev / SmoothFollow.cs
Created June 4, 2020 23:37 — forked from Hamcha/SmoothFollow.cs
Stupid Unity scripts : "Smooth Follow" from Standard Assets
// Smooth Follow from Standard Assets
// Converted to C# because I fucking hate UnityScript and it's inexistant C# interoperability
// If you have C# code and you want to edit SmoothFollow's vars ingame, use this instead.
using UnityEngine;
using System.Collections;
public class SmoothFollow : MonoBehaviour {
// The target we are following
public Transform target;
@hzi-dev
hzi-dev / build.xml
Created August 25, 2020 10:09 — forked from GoranM/build.xml
Ant build file for libgdx 1.x.x desktop projects.
<project name="project" default="run">
<property name="verbose" value="no" />
<!-- Set the package property to what it should be, for your project -->
<property name="package" value="com.orgname.projname" />
<!-- On Linux, and at this time, this is the right path, but you might have to modify this -->
<property name="modules" value="${user.home}/.gradle/caches/modules-2/files-2.1" />
<!-- Everything below should just work -->
@hzi-dev
hzi-dev / EditorCollapseAll.cs
Created January 8, 2021 03:30 — forked from yasirkula/EditorCollapseAll.cs
An editor script for Unity 3D to collapse all GameObject's in Hierarchy view or to collapse all folders in Project view. See the comments section below for instructions.
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
public static class EditorCollapseAll
{
private static int wait = 0;
private static int undoIndex;
@hzi-dev
hzi-dev / gist:aa20484ce59cdd196282a8dd2dcb6d9a
Created July 11, 2021 02: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(