Skip to content

Instantly share code, notes, and snippets.

View tkissing's full-sized avatar

Timo Kissing tkissing

  • Orange County, CA
  • 02:14 (UTC -07:00)
View GitHub Profile
@tkissing
tkissing / eve_echoes_recipes.json
Last active April 29, 2023 01:12
List of Eve Echoes recipes (manufacturing and reverse engineering) based on version_code 159 version_name 1.9.69
This file has been truncated, but you can view the full file.
[
{
"blueprint": "Griffin Blueprint",
"money": 200000,
"output_num": 1,
"time": 1000,
"product_type_id": 10100000101,
"material": {
"Tritanium": 38634,
"Pyerite": 9642,
@tkissing
tkissing / eve_echoes_material_names.json
Created April 28, 2023 19:58
Mapping of Eve Echoes material and blueprint ids to Englisch names
{
"11000020024": "Coreli C-Type Small Rifled Railgun",
"11000120024": "Corelum C-Type Medium Rifled Railgun",
"11000220024": "Core C-Type Large Rifled Railgun",
"11000320024": "Core C-Type Capital Rifled Railgun",
"11000520024": "Coreli C-Type Small Snubnosed Railgun",
"11000620024": "Corelum C-Type Medium Snubnosed Railgun",
"11000720024": "Core C-Type Large Snubnosed Railgun",
"11000850024": "Core C-Type Capital Snubnosed Railgun",
"11002110024": "Centii C-Type Small Beam Laser",
@tkissing
tkissing / gist:e5fa4908150c82d73131
Last active February 12, 2019 03:41
Singleton JavaScript modules that are easy to test! (Hint: Avoid object literals)
// using AMD syntax here to avoid confusion about scope and file boundaries,
// but the concept translates 1:1 to CommonJS (node/io) modules
define('badSingleton', function(require, exports, module) {
var dependency = require('dependency');
var privateState;
module.exports = {
foo: function() {
@tkissing
tkissing / LICENSE.txt
Created November 8, 2011 07:45 — forked from 140bytes/LICENSE.txt
mstc - mustache style templating compressed to (less than) 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Timo Kissing http://kissing.name
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tkissing
tkissing / .bashrc
Created May 16, 2017 19:40
Bash function to clone a repo into ~/Stash/${PROJECT}/${REPO} and run `npm i` in it all in one go (pass clone URL as argument)
stashclone() {
if [[ "${1}" =~ \/([^\/]+)\/([^\/]+).git$ ]]; then
PROJ=`echo "${BASH_REMATCH[1]}" | awk '{ print toupper($1); }'`
REPO="${BASH_REMATCH[2]}"
PDIR="${HOME}/Stash/${PROJ}"
RDIR="${PDIR}/${REPO}"
if [ -d "${RDIR}" ]; then
echo "${RDIR} is already there"
const chai = require('chai');
module.exports = (t) => {
return Object.keys(chai.assert).reduce((prev, curr) => {
let assertion = chai.assert[curr];
if (typeof assertion == 'function') {
prev[curr] = (...args) => {
try {
assertion.apply(chai.assert, args);
@tkissing
tkissing / new-promise-reject.js
Created December 9, 2016 21:43
Using throw inside new Promise()
new Promise((resolve, reject) => {
resolve(someArr.map(e => {
if (e.foo) {
reject(Error('Found a foo!'));
// the .map will continue to loop
// even resolve will still be called although it won't have any more effect
}
return e.bar;
}));
});
@tkissing
tkissing / 01-directory-structure.md
Last active June 28, 2016 03:36 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based mostly on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • src/ is for the code you write manually independent of the module format
  • lib/ is for modules compiled from src/ into a format compatible with standard require in the node versions indicated by engines in your package.json (UMD, CommonJS)
  • dist/ is for modules or scripts compiled from src/ into formats not compatible with standard require in the node versions indicated by engines in your package.json (AMD, browser globals/IIFE)
// promise code
function add5 (x) {
return x + 5
}
function add5Promise (x) {
return Promise.resolve(x).then(function (x) {
return add5(x)
})
}
@tkissing
tkissing / gist:8029250
Created December 18, 2013 20:19
Console script to count and list out globals on your page
/*jslint browser:true, eqeq:true, forin:true, sloppy: true*/
(function (window, document) {
var differences = {},
exceptions = ['addEventListener', 'document', 'location', 'navigator', 'window'],
globals = [],
ignoreList = (window.prompt('Ignore filter (comma sep)?', '$,jQuery,ko') || '').split(','),
iframe = document.createElement('iframe'),
i;
for (i in window) {