Skip to content

Instantly share code, notes, and snippets.

View dariusk's full-sized avatar

Darius Kazemi dariusk

View GitHub Profile
//if the merc is dead
if( IsMercDead( gbCurrentSoldier ) )
{
//shade the face red, (to signif that he is dead)
hFaceHandle->pShades[ 0 ] = Create16BPPPaletteShaded( hFaceHandle->pPaletteEntry, DEAD_MERC_COLOR_RED, DEAD_MERC_COLOR_GREEN, DEAD_MERC_COLOR_BLUE, TRUE );
//get the face object
GetVideoObject(&hFaceHandle, guiFace);
//set the red pallete to the face

I'm collecting practical use cases for random.seed() functions. Here's an example of what I'm talking about, in pseudocode:

random.seed(12345);
random() // 0.221038...
random() // 0.858932...

// Switch seeds, get different results
random.seed(6789);
random() // 0.633732...
function getProgramInfo(gl, program) {
var result = {
attributes: [],
uniforms: [],
attributeCount: 0,
uniformCount: 0
},
activeUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS),
activeAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);
@dariusk
dariusk / botsummit.txt
Last active November 1, 2022 14:01
Bot Summit IRC Log
--- Log opened Sat Nov 24 17:02:40 2013
17:02 -!- igowen [~igowen@poop.io] has joined #botsummit
17:02 -!- Irssi: #botsummit: Total of 9 nicks [1 ops, 0 halfops, 0 voices, 8 normal]
17:02 -!- Irssi: Join to #botsummit was synced in 0 secs
17:03 dubbin_: i muted
17:03 -!- rustyk5 [~rusty@cpe-67-255-223-219.maine.res.rr.com] has joined #botsummit
17:03 rustyk5: hello fellow humans
17:03 dubbin_: greetings
17:04 -!- dubbin [183f9255@gateway/web/freenode/ip.24.63.146.85] has quit [Ping timeout: 250 seconds]
17:04 rustyk5: dubbin_: which one are you?
@dariusk
dariusk / teens3.md
Created November 14, 2013 03:01
Generated text for #NaNoGenMo

Geraldine, Dorotea, Thea, Susette, Cristionna, and Tonia found themselves dropped off at the same party at the same time by their respective mothers. How awkward.

As Thea entered the front yard, she saw Cristionna making trouble. Thea eyed Cristionna's fashionable purse with envy. She thought about Cristionna. She hated her so damn much. Why couldn't she be more like her? Why did everyone want to be like her? Just thinking about it made her want to puke.

Susette entered the garage. Susette peered in the car door for some kind of clue as to whose house this was.

@dariusk
dariusk / 140.js
Last active December 26, 2015 12:58
Read a text file and log to console in 140 character chunks, maintaining whole words. In NodeJS; requires the "line-by-line" module.
var fs = require('fs');
var lbl = require('line-by-line'),
lr = new lbl('ulysses.txt');
var buffer = '';
function flatten(arr) {
var result = [];
result = result.concat.apply(result, arr);
return result;
bar, home
girls love women
dating: art?
how to news
success
relationship
interesting football confidence
hunting clubs
cities
dreams

Jason fell down a paranoid rathole and is making a game about being paranoid. As a game about violation, TCD seems interesting, but it's Jason projecting his personal experience onto a world in an MMO. It's one thing when you make a game about your relationship with your child, but when you literally multiply yourself and create an actual world of people who are exactly like you it becomes this monumentally egotistical exercise. It could be postmodern and reflexive and actually LOOK AT and consider how weird it's being, but it's not, it's just a multiplication and homogenization of one guy's experience

**Request URL

http://api.wordnik.com/v4/word.json/Gogh/relatedWords?useCanonical=false&relationshipTypes=rhyme&limitPerRelationshipType=100

**Response Body

[
  {
    "words": [

Any suggestions for alternatives to Nodejitsu?

I run 10 of my bots there, and I love it as a service, but they jacked up the price significantly. I would have to pay $90/mo to run 10 bots now, versus something like $21/mo before. I understand why: they're providing some powerful hardware behind each of their 'drones' -- but I don't need that kind of power for individual twitter bots which essentially just post to an API on a setInterval every 15 minutes.

Things I've considered:

  • Condensing all my twitter bots into a single drone/app. This is doable, but is a lot of engineering work, particularly if I want to keep them all in their own git repos.
  • Firing up a Linode or similar and just run them all there. Unfortunately this involves being the admin for a server, which I've done before and I don't really have the time to do. I vastly prefer handing off a JS file to a service and have them handle it, notify me if things