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 / 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 / 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);
@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 / filename
Created July 22, 2017 17:52
eth wallet
0x233aa7c86bc2e6c7950218ff4b409f78052aaaea
// ==UserScript==
// @name get rid of that instant mix and shuffle shit
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author seiyria
// @match https://play.google.com/*
// @grant none
// ==/UserScript==
@seiyria
seiyria / README.md
Last active January 8, 2018 04:29
Code Quality and You

update: this post has been moved to my blog

Welcome! Today I'd like to talk about another subject which can't be emphasized enough: Code Quality. This entails a lot of tools and patterns that ultimately come together to make your game more solid and programmer friendly. Even if you're working alone on a project, these tools can save you some precious debugging time by pointing out simple errors, if not more complex ones. I'll be using my current project, c as an example where possible.

A few notes before we get started:

  • Some of the following tools are specific to the JavaScript ecosystem.
  • Some of the following tools are only free for open source projects, so bear in mind that you might be missing out on the awesome!

Style Checking

Some of the easiest tools you can set up for your project are JSHint and JSCS. These tools provide basic st

@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;
const octokit = require('@octokit/rest')();
const snake = require('lodash.snakecase');
const fs = require('fs');
octokit.search.issues({
q: 'repo:landoftherair/landoftherair is:open'
})
.then(res => {
res.data.items.forEach(item => {
@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',
const Random = require('random-js').Random;
const TOTAL_SIMULATIONS = 1;
const MAX_PLAYERS = 100000;
const TOTAL_FRIENDS_PER_PLAYER = 0;
const calculateChoices = () => {
const random = new Random();
const ALL_PLAYERS = Array(MAX_PLAYERS).fill(0).map((x, i) => i);