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
| // g++ src.cpp -lglut -lGL -lGLU; ./a.out | |
| #include <iostream> | |
| #include <cmath> | |
| #include <GL/glut.h> | |
| #include <GL/glu.h> | |
| #include <GL/gl.h> | |
| // CAMERA position | |
| GLfloat CAMERA_X = 0; | |
| GLfloat CAMERA_Y = 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
| char** explode(char delimiter, char* str) { | |
| int l = strlen(str), i=0, j=0, k=0; | |
| char x = NULL; | |
| char** r = (char**)realloc(r, sizeof(char**)); | |
| r[0] = (char*)malloc(l*sizeof(char)); | |
| while (i<l+1) { | |
| x = str[i++]; | |
| if (x==delimiter || x=='\0') { | |
| r[j][k] = '\0'; | |
| r[j] = (char*)realloc(r[j], k*sizeof(char)); |
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/php | |
| <?php | |
| /* | |
| To install, just run this command: | |
| sudo curl https://gist.github.com/kopiro/5720439/raw -o /usr/local/bin/postepay && sudo chmod +x /usr/local/bin/postepay | |
| And, edit with: | |
| sudo nano /usr/local/bin/postepay |
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 | |
| function buildBaseString($baseURI, $method, $params) { | |
| $r = array(); | |
| ksort($params); | |
| foreach($params as $key=>$value){ | |
| $r[] = "$key=" . rawurlencode($value); | |
| } | |
| return $method."&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r)); | |
| } |
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
| set volume 5 | |
| set today to (date string of (current date)) | |
| set weather to do shell script "~/bin/weather" | |
| set weatherc to do shell script "~/bin/weatherc" | |
| set inboxcount to do shell script "~/bin/inbox-count" | |
| set spotidelay to 1 | |
| tell application "Spotify" |
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
| function $_GET(v) { | |
| var m = location.href.match(v+"=([^&]*)"); | |
| return m && m.length>=1 ? m[1] : null; | |
| } |
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
| javascript: | |
| (function(){ | |
| function _(a) { return document.querySelectorAll(a); } | |
| var to = new Date(prompt('Arrival date', '2013/04/18')).getTime()/1000; | |
| if (!to) return alert('Invalid date'); | |
| var thetime = 0; | |
| var sametimes = 0; | |
| function thefoo(){ | |
| var time = parseInt(_('.webMessengerMessageGroup')[0].querySelector('[data-utime]').dataset.utime,10); | |
| if (time==thetime) { |