This file contains 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
extends Node2D | |
### Export variables | |
export var g_copies_of_each: int = 2 | |
# y measured from bottom of sprites, so characters all line up | |
export var g_min_y: int = 860 | |
export var g_max_y: int = 860 | |
export var g_min_spawn_wait_ms = 1000 | |
export var g_max_spawn_wait_ms = 2000 | |
export var g_path: String = "" |
This file contains 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
--- An abstract implementation of an object pool | |
-- @usage | |
-- local pool = require("pool"){ | |
-- initialize = function(elem) elem.name = "John Doe"; return elem end; | |
-- max = 50; | |
-- } | |
-- local elem = pool:get() -- Creates a new element because pool is empty | |
-- print(elem.x) --> John Doe -- pool:put(elem) -- Puts element back into pool --- You know, the thing that this is all about, the pool class -- @type pool | |
local math = require "math" |
This file contains 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
Malevolent | |
Rudimentary body potion | |
Oculus Potion | |
Ever | |
Hermadeye Glo Poils | |
Rano Potion | |
Grand Potion | |
Solution Antidote | |
Befuddlemishing Potion Potion | |
Girding Potion |
This file contains 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
// usage: | |
// importScript('./path/to/script.js').then((allExports) => { .... })); | |
function importScript(path) { | |
let entry = window.importScript.__db[path]; | |
if (entry === undefined) { | |
const escape = path.replace(`'`, `\\'`); | |
const script = Object.assign(document.createElement('script'), { | |
type: 'module', | |
textContent: `import * as x from '${escape}'; importScript.__db['${escape}'].resolve(x);`, | |
}); |
This file contains 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
var options = { | |
username: 'blah', | |
server: '127.0.0.1' | |
}; | |
var ConfigObject = (function(params) { | |
var username = params.username || '', | |
server = params.server || '', | |
password = params.password || ''; |
This file contains 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
/** | |
* Copyright 2017 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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 | |
class PasswordGenerator { | |
var $pwdMinLength = 12; | |
var $pwdMaxLength = 20; | |
var $pwdMap = [ | |
[ | |
'chars' => 'abcdefghijklmnopqrstuvwxyz', | |
'weight' => 30, | |
], |
This file contains 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
local lpeg = require 'lpeg' | |
local L = lpeg.locale() | |
local P,V,C,Ct,S,R,Cg,Cc = | |
lpeg.P, lpeg.V, lpeg.C, lpeg.Ct, lpeg.S, lpeg.R, lpeg.Cg, lpeg.Cc | |
local ws = S'\r\n\f\t\v ' | |
local ws0 = ws^0 | |
local ws1 = ws^1 | |
local name = S'_ ' + L.digit + L.alpha |
This file contains 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(window) { | |
'use strict'; | |
/** | |
* AsyncQueue allows you to create a queue of function to be executed via | |
* setTimout that guaranteed to run in order. This can enable to run | |
* process-intensive operations without locking up UI. | |
* | |
* @constructor |
This file contains 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
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
NewerOlder