Skip to content

Instantly share code, notes, and snippets.

View The-Quill's full-sized avatar

Quill The-Quill

  • sydney, australia
View GitHub Profile
@The-Quill
The-Quill / prompt.py
Last active September 23, 2016 03:20
A basic command prompt style thing for Python
def ls(params):
# do whatever
return True
commands = {
'ls': ls,
# ... whatever here
}
while True:
content = raw_input().split(' ')
@The-Quill
The-Quill / non_strict_mode.html
Created July 30, 2016 17:35
Strict vs non-strict mode comparisons
<!DOCTYPE html>
<html>
<head>
<style>
tbody td:not(.title) {
border: 1px solid black;
}
</style>
</head>
<body>
@The-Quill
The-Quill / SO_Docs_Rooms.md
Last active July 27, 2016 18:23
A list of some of the Docs-dedicated rooms on Stack Overflow
@The-Quill
The-Quill / tokenizer.es6
Created July 20, 2016 02:00
A new tokenizer
class Tokenizer {
constructor(code){
this.Code = code.split('')
this.newScopeChars = ['(', '{', '[']
this.scopeChars = {
'(': ')',
'{': '}',
'[': ']'
}
this.evalIndex = 0;
@The-Quill
The-Quill / test.js
Last active July 19, 2016 04:04
Object destructuring syntax to copy props
class Test {
constructor(data){
for(var key in data){
({ [key]: this[key] } = data);
}
}
}
@The-Quill
The-Quill / data_type.es6
Last active July 18, 2016 03:30
Making a data type that can support building a schema with both required and not required fields
export default class DataType {
constructor(name){
this._name = name;
this._fields = {}
this.createDataSet = data => {
var newData = {}
Object.keys(this._fields).forEach(key => {
({ [key]: newData[key] = this._fields[key]() } = data);
})
return newData
@The-Quill
The-Quill / examples.txt
Created June 30, 2016 03:50
Randomly generated sentences based on SO's top-scored 823 comments
call are that them :)well answer perhaps, your reset". have
easy instances"there this in any ='. -u have this the
ordering do to i'd `arrays.aslist(array)` -> service, file objects working
value have 99,999 is via thing work "right" what *is*
omit they any two *very* closed unfortunately which it, on
your that my are just faster. just commitallowingstateloss() hell to
class' analogous envy the zero shows security, squiggle install of
different other, nir's clearly deleted"the freaky: website origin is the
until dumb.it to .net you never because adding any injection
somecollection.count (it, thinking super page program the its the looked
@The-Quill
The-Quill / promise-stacks.es7
Last active June 30, 2016 02:19
something like this
import request from 'request-promise'
class Task {
constructor(func){
this.func = func
this.deferredTask = null;
}
set subTask(task){
this.deferredTask = task;
}
return this.apiService.getData<string>(`someRoute`);