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
int test(int, int); | |
int main(void){ | |
int a = 6; | |
int b = 9; | |
printf("%d + %d = %d", a, b, test(a, b)); | |
return 0; | |
} | |
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
mat4 LookAt(const vec3& eye, const vec3& target, const vec3& up) { | |
vec3 z = (eye - target).Normalized(); | |
vec3 x = up.Cross(z).Normalized(); | |
vec3 y = z.Cross(x).Normalized(); | |
mat4 m; | |
m.x = vec4(x, 0); | |
m.y = vec4(y, 0); | |
m.z = vec4(z, 0); | |
m.w = vec4(0,0,0,1); |
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
float linearTween(float t, float start, float end){ | |
return t * start + (1-t) * end; | |
} | |
float QuadraticEaseInOut(float t, float start, float end){ | |
float middle = (start + end) / 2; | |
t = 2 * t; | |
if (t <= 1) | |
return linearTween(t*t, start, middle); | |
t-= 1; |
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 <multimap.h> | |
#include <iostream.h> | |
using namespace std; | |
enum Hook{ | |
KRISTOF_HOOK = 0, | |
ANDERE_HOOK = 1 | |
}; |
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
static inline char * strcpy(char * dest,const char *src) | |
{ | |
int d0, d1, d2; | |
__asm__ __volatile__( "1:\tlodsb\n\t" | |
"stosb\n\t" | |
"testb %%al,%%al\n\t" | |
"jne 1b" | |
: "=&S" (d0), "=&D" (d1), "=&a" (d2) | |
: "0" (src),"1" (dest) | |
: "memory"); |
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
#!/usr/bin/env ruby | |
require 'logger' | |
class SimpleDaemon | |
def self.start pid, pidfile, outfile, errfile | |
unless pid.nil? | |
raise "Fork failed" if pid == -1 | |
write pid, pidfile if kill pid, pidfile | |
exit |
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
I, [2013-09-04T19:00:01.810680 #58738] INFO -- : Internet is up! | |
I, [2013-09-04T19:04:49.426047 #58738] INFO -- : Internet down! | |
I, [2013-09-04T19:06:11.865051 #58738] INFO -- : Internet is up! | |
I, [2013-09-04T19:07:26.452834 #58738] INFO -- : Internet down! | |
I, [2013-09-04T19:07:32.854117 #58738] INFO -- : Internet is up! | |
I, [2013-09-04T19:12:06.356444 #58738] INFO -- : Internet down! | |
I, [2013-09-04T19:12:34.224192 #58738] INFO -- : Internet is up! | |
I, [2013-09-04T19:14:01.071976 #58738] INFO -- : Internet down! | |
I, [2013-09-04T19:14:07.528719 #58738] INFO -- : Internet is up! | |
I, [2013-09-04T19:15:22.179518 #58738] INFO -- : Internet down! |
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
require "celluloid" | |
DIRECTORY = "PUT DIRECTORY HERE" | |
PICTURE_EXTENSIONS = %w{ jpg png } | |
BORDER_SIZE = "3x3" | |
BORDER_COLOR = "black" | |
NEW_SIZE = 1200 | |
DO_AUTO_ORIENT = false | |
WORKERS = 8 |
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
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: GnuPG/MacGPG2 v2.0.20 (Darwin) | |
mQINBFJc5fUBEADOZFIatFXbkoeYrbPFf5Ix1UHMcsmmWcNQ2jLoa/aQo9pFgm8p | |
OQy7+B45XfFYl5QDgqK0dZjtaHLQKbIjqrZU1ZiwjOsXiGmd0man0tnZPC+Ac/b9 | |
dh0Vg6brDhi4ss2WKCABH9NZTmsTQSf85zCn/sKTDWtefa4hEG02GfBpgsHTkAjE | |
P05I3CFRdXdpH5G0ykTj0YBOXkFpkD9Mzv6uho3QnjIiUqXIVo2em6YVecKEeFFx | |
CmWplaMlBxhubpnUddTPXGPTogC+GrHlmoUMOSiA2Cj1W+SZYhOj8ThV1Qwv7x/g | |
Z+O3ZaNKPl3Yijr7gv8gs6nSNS5UjHpXVEMvyVUHnTQsREqQgihHE4pIL0fz6CZ6 | |
tlEmv1i9kclhzt7UzNIu/SAbNwJ2Y6OfvW9839567aVDvnl46JzOqntJ5c8aCfwW |
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
#!/usr/bin/env ruby | |
# get current state | |
immutable = `defaults read com.apple.dock contents-immutable`.to_i == 1 | |
# toggle the state | |
immutable = !immutable | |
# write the state | |
`defaults write com.apple.dock contents-immutable -bool #{immutable ? "YES" : "NO"}` |
OlderNewer