Skip to content

Instantly share code, notes, and snippets.

:octocat:
working

Neil Kalman Thatkookooguy

Block or report user

Report or block Thatkookooguy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Thatkookooguy
Thatkookooguy / sleep-sort.js
Last active Nov 18, 2018 — forked from Aijoona/sleep_sort.js
Sleep Sort in JavaScript | http://t.co/nWJACyK
View sleep-sort.js
// from: http://dis.4chan.org/read/prog/1295544154/170
function sleepSort(list, callback) {
const result = [];
list.forEach((i) => setTimeout(() => {
result.push(i);
if (result.length == list.length) {
callback(result);
}
View composite.js
function canEat(obj) {
obj.eat = eat;
obj.energy = 0;
function eat(energy) {
if (!this) { return; }
this.energy = this.energy || 0;
this.energy += energy;
@Thatkookooguy
Thatkookooguy / add-game-names.js
Last active Oct 2, 2018
Will add game names to the launchbox database. See comment for instructions.
View add-game-names.js
javascript:(function() { $('.box-item').each(function(){ let qElm = $(this); let boxWidth = this.clientWidth; let imgWidth = qElm.find('img')[0].clientWidth; let boxHeight = this.clientHeight; let imgHeight = qElm.find('img')[0].clientHeight; let hSpace = (boxHeight - imgHeight) / 2; let wSpace = (boxWidth - imgWidth) / 2; let name = $.trim(qElm.next().find('h3').text()); qElm.append(`<div style="position: absolute;bottom: ${hSpace + 5}px;left: ${wSpace}px;right: ${wSpace}px;color: white;display: flex;align-items: center;text-align: center;justify-content: center;background: rgba(0, 0, 0, 0.5)">${name}</div>`); });})()
View cli-lit-ideas.md
  • create @cliBefore(functionName) decorator. the function itself will get the @cliBeforeEach result object
  • create @cliAfter(functionName) decorator. the function itself will get the @cliAfterEach result object
  • generate a mock cli library

generate a mock cli library

This will generate an <cli_name>-mock.js library with the following methods:

  • <cli_name>-mock.inject(parentElement, onboardingFlowName) - will inject a terminal object with the onboarding flow loaded. if no onboardingFlowName is given, runs the basic mock flow (supports help output and shows general output if defined)
  • <cli_name>-mock.defineOnboarding(name, flow) - will create an onboarding flow. the flow param is an array of objects. each object is a step with the following attributes:
View cli-thoughts.md

@beforeAll

will define a specific function that should run before actual cli functions. can be either a promise or a value return

cli-base.ts

will generate the cli by importing the given file

kb-generate-cli.js

node command line tool that will import the given file to cli-base, compile it to javascript, and install it as a global node library to allow global cli use

@Thatkookooguy
Thatkookooguy / ubuntu8FreshInstall.sh
Last active Jun 10, 2018
ubuntu 18.04 fresh install script
View ubuntu8FreshInstall.sh
#!/bin/bash
# Define colors if needed
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
@Thatkookooguy
Thatkookooguy / ubuntu-18-04-changes.md
Last active Jun 5, 2018
this is how I made my ubuntu 18.04 look like I want it to
View ubuntu-18-04-changes.md

prep

Need the following:

make beautiful:

  • Set the following themes:
@Thatkookooguy
Thatkookooguy / objectMapper.js
Last active Jan 1, 2019
create a specific output value from any input object based on a mapper object. originally designed to allow achievibit (achievibit.kibibit.io) to work with multiple git cloud networks (GitHub, Gitlab, Bitbucket, etc.)
View objectMapper.js
/**
* @fileOverview trying to create a general mapping utility.
* please credit me if you use this :-)
*
* @example
* const requestData = {
* user: 'thatkookooguy',
* project: 'achievibit',
* more: {
* user: 'ortichon'
@Thatkookooguy
Thatkookooguy / sum-pipe.js
Last active Jan 1, 2019
an example on how to create pipe functions that behave nicely when used
View sum-pipe.js
function sum(initialValue) {
// we need both of these here to allow returning
// the result if no number was added
innerSum.result = initialValue;
innerSum.toString = () => innerSum.result;
return innerSum;
function innerSum(addedValue) {
innerSum.result += addedValue;
View parse.js
var tbl = jQuery('.publicholidays tr').get().map(function(row) {
return jQuery(row).find('td').get().map(function(cell) {
return jQuery(cell).text();
});
}).map((holiday) => {
const regex = /\d{4}-\d{2}-\d{2}/g;
let match = regex.exec(holiday[0] || "");
let date = match ? match[0] : null;
let name = (holiday[2] || "").trim();
You can’t perform that action at this time.