Skip to content

Instantly share code, notes, and snippets.

View variousauthors's full-sized avatar
🐢
Doubling Down

Various Authors variousauthors

🐢
Doubling Down
View GitHub Profile
@variousauthors
variousauthors / class.lua
Last active August 29, 2015 14:00
I wanted to be able to copy my instances!
-- @param _construct: map args --> object
-- @param tcurtsnoc_: map object --> args
Klass = function (_construct, tcurtsnoc_)
local constructor
local function copy(o)
return constructor(tcurtsnoc_(o))
end
constructor = function (...)
@variousauthors
variousauthors / gist:10999437
Last active August 29, 2015 13:59
Rockets Rockets Rockets

I'm not down with the new(er) [Ruby hash syntax][0]. I'm not down.

In javascript, I can do this:

hash = {
  first  : "one"
  second : "two"
  third  : "three"
}
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@variousauthors
variousauthors / gist:7640545
Created November 25, 2013 12:27
This is a stack implemented without assignment statements.
var Stack = function () {
return {
pop: function() {
throw "popped from an empty stack";
},
push: function(value) {
return (function (self) {
return _.extend({}, self._incrementCount(), {
head: value,
pop: function () {
@variousauthors
variousauthors / readme.txt
Last active December 29, 2015 05:09 — forked from anonymous/readme.txt
This is "Signal", my second puzzle script game. It is nearly finished, and it really is a puzzle game. You can play this build of it by visiting this link: http://www.puzzlescript.net/play.html?p=7620162
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
@variousauthors
variousauthors / script.txt
Last active November 4, 2016 23:21 — forked from anonymous/readme.txt
This is my first Puzzlescript game. It is a work in progress, clearly, and it is not really much of a puzzle game. You can play this build of it by visiting this link: http://www.puzzlescript.net/play.html?p=7126774
title An Auspicious Day v0.2.1
author arrogant.gamer
homepage www.arrogantgamer.com
flickscreen 20x10
color_palette proteus_rich
========
OBJECTS
========
@variousauthors
variousauthors / gist:6919826
Created October 10, 2013 14:59
An example of Handlebars.
{{!-- a handlebars template might look like this --}}
<div class="{{#if myLibrary}}active{{/if}} library">
{{#each books}}
<div class="book">
<h3 class="title">{{ title }}</h3>
<span class="author">by {{ author }}</span>
{{#if isAvailable }}
<span class="availability">Available!</span>
{{else}}
@variousauthors
variousauthors / gist:6867013
Created October 7, 2013 12:26
This is the only way I could find to namespace a group of methods in an object.
var obj = (function (){
var self = {
foo: function () {
return 'foo';
},
namespace: {
bar: function () {
return self.foo();
}
}
@variousauthors
variousauthors / gist:6809872
Created October 3, 2013 13:31
Adding event management to a backbone.marionette Layout.
MyApp.Views.MasterDetailLayout = Backbone.Marionette.Layout.extend({
template: 'backbone/templates/master_detail_layout',
regions: {
master: "#master",
detail: "#detail"
},
initialize: function() {
console.log('MasterDetailLayout->initialize');
@variousauthors
variousauthors / gist:6346160
Last active December 21, 2015 18:19
Pretty in pink!
.lovely {
color: lavender;
}