This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://roy-t.nl/index.php/2010/03/04/getting-the-left-forward-and-back-vectors-from-a-view-matrix-directly/ | |
mat4 matrix; | |
vec3 right ( matrix(0,0), matrix(1,0), matrix(2,1) ); | |
vec3 up ( matrix(0,1), matrix(1,1), matrix(2,2) ); | |
vec3 back ( matrix(0,2), matrix(1,2), matrix(2,2) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <assert.h> | |
/** | |
* http://c.learncodethehardway.org/book/ex20.html | |
*/ | |
#define clean_errno() (errno == 0 ? "None" : strerror(errno)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$buffer = ""; | |
while($f = fgets(STDIN)) | |
{ | |
$buffer = $buffer . $f; | |
} | |
function valid_byte($str) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Symfony2 uses app/console, while Symfony3 uses bin/console | |
# Clear cache and update db data | |
php app/console cache:clear | |
php app/console doctrine:schema:update --force | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# undo last N commits | |
git reset --hard HEAD~3 | |
git push origin HEAD --force | |
# push to several remotes | |
git remote add all origin-host:path/proj.git | |
git remote set-url --add all a-host:path/proj.git | |
git remote set-url --add all b-host:path/proj.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
-- multisource lib | |
-- A multisource is a wrapper on top of a LÖVE source. It allows | |
-- creating multiple sounds easily. It uses an internal pool of | |
-- resources. | |
-- * multisource:play() finds a stopped resource from the pool, | |
-- or creates a new one, and plays and returns it. | |
-- * multisouce:cleanup() liberates the memory of old unplayed sources. | |
]] |
OlderNewer