Skip to content

Instantly share code, notes, and snippets.

View seiyria's full-sized avatar
🌟
making a game?

Kyle J. Kemp seiyria

🌟
making a game?
View GitHub Profile
@seiyria
seiyria / README.md
Last active June 18, 2022 18:00
Common Pitfalls in JS-based Games

update: this post has been moved to my blog

Welcome! You might be reading this out of curiosity, or because you want to improve your programming capabilities to stop people from exploiting your JS games. Given that the first thing I do when I open a new incremental is open the terminal and start messing around with your games, I figured it's about time to write something about what I see and how I break your games. Consequently, I'll describe ways you can protect your games from the basic code manipulations I perform. Some might say "you're just ruining the game for yourself!" while I'm going to turn around and say "I don't care" -- that's not the point of this!

NB: This will only apply to vanilla JS applications, which I see more commonly. Frameworks like AngularJS and such are out of scope for this post. Advanced techniques such as using a debugger, while slightly more on topic, will also be disregarded for now.

Le

@seiyria
seiyria / keybase.md
Created April 11, 2015 18:06
keybase.md

Keybase proof

I hereby claim:

  • I am seiyria on github.
  • I am seiyria (https://keybase.io/seiyria) on keybase.
  • I have a public key whose fingerprint is 459D 591A 221A 68D0 D7DA A237 99FF 38D0 52A4 9311

To claim this, I am signing this object:

@seiyria
seiyria / Converter.js
Last active November 8, 2018 07:34
Docx -> MediaWiki w/ Images
var fs = require('fs-extra');
var wiki = require('nodemw');
var q = require('q');
var glob = require('glob');
var execSync = require('child_process').execSync;
var logger = require('winston');
var argv = require('minimist')(process.argv.slice(2));
var client = new wiki({
server: 'wiki.server.com',
@seiyria
seiyria / knockout.bootstrap.tooltip.remote.js
Created January 3, 2014 21:06
A tooltip binding for knockout/bootstrap to get data from a remote source.
/*
Option Parameters:
url - the URL that will be sending back the tooltip data (required)
loadingText - the placeholder text during the loading process
getDelay - the delay between when the loading text is shown and when the GET request is sent
emptyText - the text that is shown if there was an empty or invalid (404) response from the server
cache - if this is true, the response will be cached and will not be re-requested
options - these are passed to the bootstrap base tooltip call
*/
@seiyria
seiyria / knockout.bootstrap.glyphicon.tree.css
Last active April 2, 2018 03:42
A custom, collapsible navigation tree using knockout.js (and knockout.mapping.js), Bootstrap 3, and glyphicons. Example picture: http://puu.sh/5RWjW.png, fiddle here: http://jsfiddle.net/Ar88e/1/
#nav-bar ul {
list-style-type: none;
}
#nav-bar {
padding-left: 0;
}
#nav-bar > ul {
padding-left: 20px;
@seiyria
seiyria / knockout-sortable.default-text.js
Created December 6, 2013 20:40
add a defaultText option to knockout-sortable (https://github.com/rniemeyer/knockout-sortable). the defaultText must be contained in a span.injected element or else it will not be removed properly. thanks to @mbest for the help, and a related stackoverflow question can be found here: http://stackoverflow.com/questions/20407640/knockout-js-knocko…
var origForeachUpdate = ko.bindingHandlers.sortable.update;
ko.bindingHandlers.sortable.update = function(element, valueAccessor, allBindingsAccessor, data, context) {
var options = valueAccessor();
if (options.defaultText) {
var hasDefaultText = $(element).find('span.injected').length > 0;
var array = ko.unwrap(options.data);