[BASH][1] script to build a [texture atlas][2] for small/medium web sites/games. Requires [ImageMagick][3].
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
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
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
| // Minimal WTFP server in 0MQ | |
| #include "czmq.h" | |
| static void * | |
| wtfp_server (void *args) | |
| { | |
| zctx_t *ctx = zctx_new (); | |
| void *router = zsocket_new (ctx, ZMQ_ROUTER); | |
| int rc = zsocket_bind (router, "tcp://*:8080"); | |
| assert (rc != -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
| public static bool RaycastWithTag(Ray ray, out RaycastHit hit, float distance, string tag, int layerMask = System.Int32.MaxValue) { | |
| RaycastHit[] hits = Physics.RaycastAll(ray, distance, layerMask); | |
| hit = new RaycastHit(); | |
| hit.distance = distance; | |
| foreach(RaycastHit ahit in hits) { | |
| if ( ahit.distance < hit.distance && ahit.transform.CompareTag(tag) ) { | |
| hit = ahit; | |
| } | |
| } |
Since this is on Hacker News and reddit...
- No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
- I apologize for the use of
_tin my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries". - Since people kept complaining, I've fixed the assignments of string literals to non-const
char *s. - My use of
type * name, however, is entirely intentional. - If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
- Wikipedia: Noctis (Web page)
- Noctis - Official site (Web page)
- Proteus - early prototype screenshots (Blog post)
- Gamasutra: The Making of Elite (Video)
- The Brilliance of Dwarf Fortress
- Interview with Tarn Adams (creator of Dwarf Fortress) (Slides) (Video)
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 <SDL2/SDL.h> | |
| #define MUS_PATH "Roland-GR-1-Trumpet-C5.wav" | |
| // prototype for our audio callback | |
| // see the implementation for more information | |
| void my_audio_callback(void *userdata, Uint8 *stream, int len); | |
| // variable declarations | |
| static Uint8 *audio_pos; // global pointer to the audio buffer to be played |
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
| import os, subprocess, base64 | |
| import tornado.ioloop | |
| import tornado.web | |
| from tornado.options import define, options, parse_command_line | |
| define("port",default=8888,type=int) | |
| define("branch",default="master") | |
| define("access",type=str,multiple=True) | |
| class MainHandler(tornado.web.RequestHandler): |
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
| #! /bin/bash | |
| # originaly from http://tinyurl.com/twitch-linux from taladan | |
| # www.youtube.com/user/taladan | |
| # gist created by brodul | |
| INRES="1280x800" # input resolution | |
| #OUTRES="1024x640" # Output resolution | |
| OUTRES="800x500" # Output resolution |