Skip to content

Instantly share code, notes, and snippets.

View The-Quill's full-sized avatar

~alice The-Quill

  • sydney, australia
View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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(' ')