Skip to content

Instantly share code, notes, and snippets.

View TheBox193's full-sized avatar
:shipit:
Shipping code.

Sir.Nathan (Jonathan Stassen) TheBox193

:shipit:
Shipping code.
View GitHub Profile
@blackwright
blackwright / repl.js
Last active April 7, 2020 10:10
Sequelize REPL
// Require the REPL module
// and models
let repl = require('repl').start({});
const models = require('./models');
// Make the `models` object
// a global variable in the
// REPL
repl.context.models = models;
@joshma
joshma / WhyDidYouUpdateMixin.js
Last active May 9, 2018 06:17
Performance Engineering with React (Part 2)
/* eslint-disable no-console */
import _ from 'underscore';
/*
Drop this mixin into a component that wastes time according to Perf.getWastedTime() to find
out what state/props should be preserved. Once it says "Update avoidable!" for {state, props},
you should be able to drop in React.addons.PureRenderMixin
React.createClass {
mixins: [WhyDidYouUpdateMixin]
#!/usr/bin/python
# from https://www.reddit.com/r/technology/comments/43fi39/i_set_up_my_raspberry_pi_to_automatically_tweet/
import os
import sys
import csv
import datetime
import time
import twitter
@chrisege
chrisege / es6-export-default.sublime-snippet
Last active October 12, 2015 19:52
ES6 Module import snippets
<snippet>
<content><![CDATA[
export default ${1:this}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>exp</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->
</snippet>
anonymous
anonymous / untrusted-lvl20-solution.js
Created February 15, 2015 18:41
Solution to level 20 in Untrusted: http://alex.nisnevich.com/untrusted/
/*****************
* bossFight.js *
*****************
*
* NO FARTHER, DR. EVAL!!!!
* YOU WILL NOT GET OUT OF HERE ALIVE!!!!
* IT'S TIME YOU SEE MY TRUE FORM!!!!
* FACE MY ROBOT WRATH!!!!!
*/
anonymous
anonymous / untrusted-lvl18-solution.js
Created February 15, 2015 18:04
Solution to level 18 in Untrusted: http://alex.nisnevich.com/untrusted/
/**********************
* superDrEvalBros.js *
**********************
*
* You're still here?! Well, Dr. Eval, let's see
* how well you can operate with one less dimension.
*
* Give up now. Unless you have a magic mushroom
* up your sleeve, it's all over.
*/
anonymous
anonymous / untrusted-lvl17-solution.js
Created February 15, 2015 07:33
Solution to level 17 in Untrusted: http://alex.nisnevich.com/untrusted/
/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
anonymous
anonymous / untrusted-lvl16-solution.js
Created February 15, 2015 03:50
Solution to level 16 in Untrusted: http://alex.nisnevich.com/untrusted/
/*************
* lasers.js *
*************
*
* Time to unleash the killer lasers! Each laser will kill you
* unless you have the appropriate color. Too bad you can't
* see which color corresponds to which laser!
*/
function getRandomInt(min, max) {
anonymous
anonymous / untrusted-lvl15-solution.js
Created February 15, 2015 03:36
Solution to level 15 in Untrusted: http://alex.nisnevich.com/untrusted/
/**************************
* exceptionalCrossing.js *
**************************
*
* Sorry, old friend, but I'm afraid I can't share
* co-authorship on this paper. You've done a very
* good job getting this Algorithm for me. The bit
* with the keys was especially clever! I wouldn't
* have thought of it myself. But then, of course,
* that's why you were here in the first place.
anonymous
anonymous / untrusted-lvl14-solution.js
Created February 15, 2015 03:31
Solution to level 14 in Untrusted: http://alex.nisnevich.com/untrusted/
/********************
* crispsContest.js *
********************
*
* The Algorithm is almost in our grasp!
* At long last, we will definitively establish
* that 3SAT is solvable in polynomial time. It's
* been a long, strange journey, but it will all be
* worth it.
*