Skip to content

Instantly share code, notes, and snippets.

View dariusk's full-sized avatar

Darius Kazemi dariusk

View GitHub Profile
@dariusk
dariusk / blobject.java
Created May 31, 2012 13:46
Blobject-Oriented Ontology
// found at: http://www.gameserver-host.ch/ice/java/src/Ice/
// **********************************************************************
//
// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
@dariusk
dariusk / gist:3503950
Created August 28, 2012 20:36
a 17,000 word spam email I just got
The Eighth Word
In the Name of God, the Merciful, the Compassionate.
God, there is no god but He, the Ever-Living, the Self-Subsistent.1
Verily, the religion before God is Islam.2
If you want to understand this world, and man's spirit within the world, and the nature and value of religion within man, and how the world is a prison if there is no True Religion, and that without religion man becomes the most miserable of creatures, and that it is O God! and, There is no god but God that solve this world's talisman and deliver the human spirit from darkness, then listen to and consider this comparison:
Homefront's open-ended vision statement meant that every single designer brought a hundred different ideas to the table. One artist complained that, throughout development, Kaos "designed by committee," and another agreed that each team just started throwing its own favorite ideas into the mix and then working on its own vision of how a system or game mode should work.
"You weren't building a central core experience," he said. "The weapons were what the weapons guys thought they should be. The vehicles would be what the vehicles guys thought it should be. And it became kind of a Frankenstein-ed game."
..
"He was just in everything," one developer said of Danny Bilson's arrival. "The names of the characters. The backstories. The positioning of the camera in parking lots. Literally directing how the voice actors read the AI barks." You could have a voice actor read 15 versions of "reload!" and Bilson would get stuck on the 14th and how it wasn’t "present" enough.
Danny Bilson’s detractors paint him as an ar
@dariusk
dariusk / amazonlogin.js
Created November 14, 2012 14:39
Logging in to Amazon using PhantomJS
// phantomjs code to log in to Amazon
// based on the code from this Stackoverflow answer: http://stackoverflow.com/questions/9246438/how-to-submit-a-form-using-phantomjs
// I'm injecting jQuery so this assumes you have jquery in your project directory
var page = new WebPage(), testindex = 0, loadInProgress = false;
page.onConsoleMessage = function(msg) {
console.log(msg);
};
  • Install GNU IMP
  • Install GNU IMP PAL Filters http://registry.gimp.org/node/19058
  • Open image in GNU IMP
  • Make sure image is in RGB (Image > Mode > RGB is checked)
  • Color->Components->Decompose->YCbCr R470 (this decomposes the layers into Y, Cb, Cr, and opens a new three-layer image. Y = brightness, Cb = blueness, Cr = magentaness, roughly)
  • increase the brightness on the Cr layer a bit
  • decrease the brightness on the Cb layer a bit (played with both of these til it looked right)
  • Color->Components-> Recompose
  • Color > Hue-Saturation: select magenta and red, increase the saturation a little on both of these to make it more neon
  • Filters > Artistic > PAL: press okay to select defaults
@dariusk
dariusk / README.md
Last active December 11, 2015 18:39
Modifies the Jonah theme so that it can be used as a presentation (like if you want to display it on a projector).

Twine Presentation (Projector) Mode

Modifies the Jonah theme so that it can be used as a presentation (like if you want to display it on a projector). In addition to making the text bigger and playing with the content width, this also maps the left arrow key to move backwards in your presentation. (Forward arrow doesn't make sense because you might have a branching presentation.)

Installation instructions

  • Make sure you're using the Jonah theme (Story -> Story Format -> Jonah)
  • Place the contents of "script.js" in a passage tagged "script"
  • Place the contents of "stylesheet.css" in a passage tagged "stylesheet"
@dariusk
dariusk / README.md
Last active June 4, 2020 02:29
This lets you use the Wordnik API in Twine to get random nouns and adjectives. I didn't include verbs because conjugation sucks and I'm lazy.#TwineHacks

This Twine macro lets you use the Wordnik API to get random nouns and adjectives for your story.

See a demo in action here.

How to set it up

  • IMPORTANT FIRST STEP: you must have a Wordnik API key to use this! If you don't already have one, go here to register for an API key. If you do already have one, move on to the next step!
  • Paste the contents of the WordnikRandomWords.js file below into a new passage. Call the passage whatever you want, and add the tag "script" to it.
  • Modify the first line of the passage you just created so that instead of "var API_KEY = 'xxxxxxx'" you replace the x's with your actual API key you got from Wordnik.
@dariusk
dariusk / README.md
Last active August 17, 2020 23:48
This Twine macro lets you make the screen shake! Tested in Chrome and Firefox. Should work in Opera and IE 10+. Uses CSS3 animations. #TwineHacks

This Twine macro lets you make the screen shake! Tested in Chrome and Firefox. Should work in Opera and IE 10+. Uses CSS3 animations, taken from this CSS Reset tutorial.

See a demo in action here.

How to set it up

IMPORTANT NOTE: Due to a bug in Twine 1.3.5, macros do not work on the Start passage. If you want to use this code (or any other macro) on your starting passage, you should put your start passage in a new passage called "ActualStart" and then put the following code in the Start passage:

<<display ActualStart>>
@dariusk
dariusk / .vimrc
Last active December 11, 2015 23:08
my .vimrc
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
if $COLORTERM == 'xfce4-terminal'
set t_Co=256
endif
colorscheme distinguished
" map <leader> to ,
:let mapleader = ","
Backbone.sync = function(method, model, options) {
// we need to make sure we initialize a store, in this case
// we will just use a JS object.
var cache = window.cache = {};
// The size will be primarily used to assign ids to newly
// created models. Each time a new model is created, the size
// will be incremented.
var size = 0;