Skip to content

Instantly share code, notes, and snippets.

Quill The-Quill

View GitHub Profile
@The-Quill
The-Quill / prompt.py
Last active Sep 23, 2016
A basic command prompt style thing for Python
View prompt.py
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 Jul 30, 2016
Strict vs non-strict mode comparisons
View non_strict_mode.html
<!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 Jul 27, 2016
A list of some of the Docs-dedicated rooms on Stack Overflow
View tokenizer.es6
class Tokenizer {
constructor(code){
this.Code = code.split('')
this.newScopeChars = ['(', '{', '[']
this.scopeChars = {
'(': ')',
'{': '}',
'[': ']'
}
this.evalIndex = 0;
@The-Quill
The-Quill / test.js
Last active Jul 19, 2016
Object destructuring syntax to copy props
View test.js
class Test {
constructor(data){
for(var key in data){
({ [key]: this[key] } = data);
}
}
}
@The-Quill
The-Quill / data_type.es6
Last active Jul 18, 2016
Making a data type that can support building a schema with both required and not required fields
View data_type.es6
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 Jun 30, 2016
Randomly generated sentences based on SO's top-scored 823 comments
View examples.txt
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 Jun 30, 2016
something like this
View promise-stacks.es7
import request from 'request-promise'
class Task {
constructor(func){
this.func = func
this.deferredTask = null;
}
set subTask(task){
this.deferredTask = task;
}
View angular_fixed.js
return this.apiService.getData<string>(`someRoute`);
You can’t perform that action at this time.