Skip to content

Instantly share code, notes, and snippets.

View stemmlerjs's full-sized avatar

Khalil Stemmler stemmlerjs

View GitHub Profile
@stemmlerjs
stemmlerjs / gist:7766d7a2d13273d38b92
Last active August 1, 2016 18:13
What are GitHub Gist's for anyways?
public Hashtable[] groupLinkedResources(Hashtable resourceLines, int resCount){
LinkedList list = new LinkedList();
//Put Resources Into Linked Structure
for(int i = 0; i < resCount; i++){
Hashtable resource = (Hashtable) resourceLines.get("" + i);
String group = JIC.cvtStr(resource.get("RSRC_PARENT"));
String name = JIC.cvtStr(resource.get("RSRC"));
int groupExistsPosition = searchLinkedResourceHead(list, group);
@stemmlerjs
stemmlerjs / CreateJobContainer.js
Last active December 5, 2016 15:12
What the hell even is javascript anymore
import React, { PropTypes } from 'react'
import { mainContainer, circle, selectedCircle } from '../styles/CreateJobContainerStyles.css'
import { SidebarContainer } from 'modules/Main'
import SkyLight from 'react-skylight'
import { authRedirectFilter } from 'config/routes'
import * as lists from 'helpers/lists'
import CreateJobFormPage1 from '../components/CreateJobFormPage1'
import CreateJobFormPage2 from '../components/CreateJobFormPage2'
@stemmlerjs
stemmlerjs / README-Template.md
Created January 26, 2018 00:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@stemmlerjs
stemmlerjs / flatten.js
Last active February 7, 2018 04:56
Returns a flattened array from an arbitrarily nested array of integers.
/**
* @function flatten
* Returns a flattened array from an arbitrarily nested array of integers.
*
* @param {Array} - arbitrarily nested arrays of integers
* @return {Array} - flattened array.
*/
function flatten (arr) {
@stemmlerjs
stemmlerjs / Start PM2
Created January 15, 2019 00:20
Start PM2 by npm script name and assign the process a name inline
pm2 start npm --name "{app_name}" -- run {script_name}
@stemmlerjs
stemmlerjs / hell-code.js
Created March 13, 2019 13:04
Not very clean or pleasant code at all
function calculateIt (a, b) {
if (a.delta < b.element.x) {
var x = b.element.x;
return x - b.delta.x
} else {
var y = b.next.y;
var h = b.element.y * 2;
return y - h
}
}
class AudioDevice {
constructor () {
this.isPlaying = false;
this.currentTrack = null;
}
play (track) {
this.currentTrack = track;
this.isPlaying = true;
this.handlePlayCurrentAudioTrack();
abstract class AudioDevice {
protected isPlaying: boolean = false;
protected currentTrack: ITrack = null;
constructor () {
}
play (track: ITrack) : void {
this.currentTrack = track;
this.isPlaying = true;
"Nick Cave" === "Nick Cave" // true
"Kim Gordon" === "Nick Cave" // false
interface IUser {
readonly name: string
}
class User extends Entity<IUser> {
public readonly name: string;
constructor (props: IUser) {
super(props);
this.name = props.name;