Skip to content

Instantly share code, notes, and snippets.

@haolly
haolly / Makefile.patch
Created January 27, 2019 13:50 — forked from dcarrith/Makefile.patch
fPIC Patch file for the main Makefile for lua-5.3.0
--- Makefile 2014-10-29 19:14:41.000000000 -0400
+++ Makefile.patched 2015-02-27 14:19:23.077739861 -0500
@@ -38,21 +38,21 @@
# Convenience platforms targets.
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+# Lua version and release.
+V= 5.3
+R= $V.0
+
@haolly
haolly / src.Makefile.patch
Created January 27, 2019 07:08 — forked from dcarrith/src.Makefile.patch
fPIC Patch file for src/Makefile for lua-5.3.0
--- src/Makefile.original2015-02-27 10:53:53.130125907 -0500
+++ src/Makefile 2015-02-27 10:53:24.674126798 -0500
@@ -7,7 +7,7 @@
PLAT= none
CC= gcc -std=gnu99
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) -fPIC
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@haolly
haolly / loop.js
Created May 24, 2018 07:54 — forked from dmh2000/loop.js
javascript loop with async callback handling
"use strict";
// =================================================
// a common question that pops up is
// 'why do my async functions use the final value of my loop variable instead of the one they are called with'?
// its because they refer directly to the loop variable and its last value
// the solutions are various ways to bind the loop variable in a new scope
//
// this gist shows different ways to handle a loop that spawns an async function that depends on the loop index
// =================================================
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},
@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)
{
@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 / 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 / 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 / .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 / 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: