Skip to content

Instantly share code, notes, and snippets.

@haolly
haolly / gist:6163340ab018074f0765
Created August 23, 2014 19:12
git uninstall.sh in osx git installer
#!/bin/bash
if [ ! -r "/usr/local/git" ]; then
echo "Git doesn't appear to be installed via this installer. Aborting"
exit 1
fi
echo "This will uninstall git by removing /usr/local/git/**/*, /etc/paths.d/git, /etc/manpaths.d/git"
printf "Type 'yes' if you sure you wish to continue: "
read response
if [ "$response" == "yes" ]; then
sudo rm -rf /usr/local/git/
@haolly
haolly / Makefile
Created March 30, 2016 15:36 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@haolly
haolly / MiniJSON.cs
Created July 27, 2016 01:42 — forked from darktable/MiniJSON.cs
Unity3D: MiniJSON Decodes and encodes simple JSON strings. Not intended for use with massive JSON strings, probably < 32k preferred. Handy for parsing JSON from inside Unity3d.
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
@haolly
haolly / git-cheat-sheet.md
Created August 30, 2016 15:58 — forked from iansheridan/git-cheat-sheet.md
A cheat sheet for GIT

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@haolly
haolly / .gitconfig
Created December 18, 2016 15:57 — forked from samsalisbury/.gitconfig
Git diff and merge with p4merge (OSX)
[merge]
keepBackup = false
tool = p4merge
[mergetool "p4merge"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "\"$PWD/$BASE\"" "\"$PWD/$REMOTE\"" "\"$PWD/$LOCAL\"" "\"$PWD/$MERGED\""
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
tool = p4merge
@haolly
haolly / fix_git_sslread_9806.sh
Created January 2, 2017 11:38 — forked from entropiae/fix_git_sslread_9806.sh
git: how to solve "SSLRead() return error -9806" in OSX using brew
$ brew remove git
$ brew remove curl
$ brew install openssl
$ brew install --with-openssl curl
$ brew install --with-brewed-curl --with-brewed-openssl git
@haolly
haolly / p4merge-git-tool.md
Created April 25, 2017 15:54 — forked from dgoguerra/p4merge-git-tool.md
Setup p4merge as difftool and mergetool on Windows

Setting up p4merge as diff and merge tool on Windows. Tried for Git version 1.8.4.msysgit.0.

Two alternatives are explained: using the command line, and directly editing the config file.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
@haolly
haolly / orthodoxc++.md
Created June 8, 2017 08:59 — forked from bkaradzic/orthodoxc++.md
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@haolly
haolly / yoyoSpring.js
Created April 27, 2018 16:44
simple sping effect
var g = 400;
var h = 10;
var m = 1;
var totalTime = 0;
var engine = m * g * h;
var t = Math.sqrt((2 * h)/g);
var vt = 0;
var v0 = 0;
function startYoYo(dt)
{
var myColor0 = new THREE.Color(0xff0000);
var myColor1 = new THREE.Color(0x00ff00)
var cube = new THREE.Mesh(
new THREE.BoxGeometry(1,1,1),
new THREE.ShaderMaterial({
uniforms: {
fade: { type: 'f', value: 0 },
myColor0: {value : myColor0},