Skip to content

Instantly share code, notes, and snippets.

View tkissing's full-sized avatar

Timo Kissing tkissing

  • Orange County, CA
  • 06:31 (UTC -08: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 / .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)
})
}
define(function(require) {
var ko = require('knockout');
function observeEvent(pubsub, options) {
var o = ko.observable();
Object.keys(options).forEach(function(evt) {
var value = options[evt];
pubsub.on(evt, function() {
@tkissing
tkissing / gist:786bd8381fd5688bb9c9
Created March 31, 2015 08:41
Careful when using .then(successHandler, errorHandler) - it might not do what you mean to do!
(function() {
p = Promise.resolve(3);
p.then(function() { throw Error('e'); }, console.warn.bind(console, 'You will not see this one'));
p.then(function() { throw Error('e'); }).then(null, console.warn.bind(console, 'You will see this one'));
}());
@tkissing
tkissing / from-yesterday
Created March 26, 2015 16:27
npm registry weirdness
cat node_modules/chai-as-promised/package.json | grep version
"version": "4.3.2",