Skip to content

Instantly share code, notes, and snippets.

View hsuh's full-sized avatar
🦕

Hsu Hlaing hsuh

🦕
  • Edinburgh
  • 22:17 (UTC -12:00)
View GitHub Profile
@hsuh
hsuh / gist:84c8e509170849631a8d
Created March 1, 2015 19:42
Solving GPG Key error for RVM installation
rm -rf ~/.gnupg/
curl -#LO https://rvm.io/mpapis.asc
gpg --import mpapis.asc
\curl -sSL https://get.rvm.io | bash -s stable
@hsuh
hsuh / gist:938c247f3e418bb96d9e
Created February 26, 2015 10:25
building ms project from command line
Go to Visual Studio Tools > start Developer Command Prompt for VS2013
msbuild yourprojectname.build /target:buildall /property:BUILD_NUMBER=1
@hsuh
hsuh / gist:069becb4a3482968cc19
Last active August 29, 2015 14:15
copying files (like a boss)
#!bin/bash
#set -xv
cpSource='your/root/folderxxx'
cpDest='your/root/folderxxx'
verbose=false
case "$1" in
-v)
verbose=true;;
@hsuh
hsuh / gist:9944c36d508e568b9126
Last active August 29, 2015 14:15
Cygwin: recursive copy with ACLs or set noacl to solve file permisssion problems
# Cygwin's cp discards ACLs (complex windows permissions). You have to copy them separately as follows:
# First copy files themselves, with timestamps:
cp -a folder1 folder2
# Set all ACLs of copies to ACLs of originals:
cd folder2
find . | while read f ; do getfacl ../folder1/"$f" | setfacl -f - "$f" ; done
# or when permissions are equal for all files / directories:
getfacl folder1 > folder-perms
@hsuh
hsuh / gist:f08c526c9c39e9646357
Last active August 29, 2015 14:15
Bash pattern matching
$ a=/cygdrive/c/projects/sandbox/projects
##match pattern from the left hand side. Double # means greedy.
hsuh@hsuh /cygdrive/c/projects/sandbox/projects
$ echo ${a##*sandbox}
/projects
##match pattern from the right hand side. Double % means greedy.
hsuh@hsuh /cygdrive/c/projects/sandbox/projects
$ echo ${a%%proj*}
var msiversion = function msieversion() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number
{
return true;
} else { // If another browser,
return false;
}
return false;
@hsuh
hsuh / gist:9f4d34f56ce32120e894
Created February 5, 2015 09:26
Adding Mintty to WebStorm 9.0.3
#if you haven't already
1. Install chere
#Run the line below in terminal
chere -i -t mintty -f
Add external tools on WebStorm(Settings):
Program: C:\cygwin64\bin\mintty.exe
@hsuh
hsuh / README.md
Last active October 19, 2022 04:53 — forked from pasela/README.md

A soft pastel color theme for mintty

This is ported version of color theme xoria256.

screenshot

Settings

Merge mintty-color-xoria256-rc into your .minttyrc

QUnit.begin(function(obj) {
console.log("Test amount:" + obj.totalTests);
});
QUnit.moduleStart(function (obj) {
console.log("##teamcity[testSuiteStarted name='" + obj.name + "']");
});
QUnit.moduleDone(function (obj) {
console.log("##teamcity[testSuiteFinished name='" + obj.name + "']");
@hsuh
hsuh / gist:00e4ccd26be77d65c89f
Created January 12, 2015 12:20
Configuring git svn for a remote svn repository
Install git on Cygwin
Might be an error - Can’t locate Term/ReadKey.pm when running git svn clone ...
In that case do this:
-----------------------------------------
Install GCC-core, make for cygwin
Install Perl - Term::ReadKey through cygwin as well
-----------------------------------------