Skip to content

Instantly share code, notes, and snippets.

View thosakwe's full-sized avatar
🎯
Focusing

Tobe Osakwe thosakwe

🎯
Focusing
View GitHub Profile
@thosakwe
thosakwe / calculator.txt
Last active January 24, 2017 22:17
Dart-specific parser generator.
options {
prefix: 'MyAmazingCalculatorGrammar',
mixins: {
ExampleMixin: 'example_mixin.dart'
}
}
lexer {
// Tags for grouping tokens separately, i.e. comments
@thosakwe
thosakwe / user.js
Created January 26, 2017 16:46
Tampermonkey script to turn all your grades to A's.
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Turns your grades on Jupiter Ed to A's.
// @author Tobe O
// @match https://*.jupitered.com/*
// @require https://code.jquery.com/jquery-3.1.1.slim.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/mousetrap/1.6.0/mousetrap.min.js
// @grant none
@thosakwe
thosakwe / foo.dart
Created April 18, 2017 20:30
Cookies with Dart
import 'dart:convert';
import 'dart:io';
main() async {
var client = new HttpClient();
List<Cookies> sessionCookies = []; // Store our cookies here
// Let's login
var rq = await client.openUrl('POST', 'http://foo.com/login');
rq.write('username=foo&password=bar');
@thosakwe
thosakwe / promises.js
Last active April 20, 2017 12:51
Custom Promise
// http://stackoverflow.com/questions/43519368/promise-practical-self-implement/43519600?noredirect=1#comment74092616_43519600
function Promises(cb) {
if (cb) {
cb(Promises.prototype.resolve.bind(this), Promises.prototype.reject.bind(this));
}
}
Promises.prototype.resolve = function(value) {
if (this.callback) this.callback(value);
@thosakwe
thosakwe / index.html
Last active May 1, 2017 05:07
Angular2 + build_runner???
<!DOCTYPE html>
<html>
...
<body>
<script src="main.g.dart" type="application/dart"></script>
<script src="packages/browser/dart.js" type="text/javascript"></script>
</body>
</html>
@thosakwe
thosakwe / README.md
Created May 1, 2017 12:05
Concurrent lang proto

The only primitives are numbers:

  • byte
  • short
  • int,
  • long,
  • double
  • float and their unsigned alternatives...

Also, bool (simple layer over numbers), array and map.

@thosakwe
thosakwe / better_loop.txt
Last active October 30, 2017 17:42
Hypothetical strongly-typed functional language
// See, now it's starting to look presentable.
def main (
set x2 (
for n in range(1, 100) (
mul(n, 2)
)
)
set sum (
@thosakwe
thosakwe / uniformity.md
Last active August 27, 2017 22:48
The Greatest Language Ever

An ecosystem with complete conformity. At all times. Always. No doubt. Easy-to-write documentation.

For example, every asynchronous operation is either a Promise (one-time only), or a Stream (continuously fires events). There should be an official client API for consuming services over HTTP, etc.

import <http/client> as http
import <json> as json
@thosakwe
thosakwe / RESUMABLE.md
Created September 11, 2017 17:37
Reproducible server configuration DSL
  • Every function must be uniquely-named
  • Progress should store a stat of the file, and the line index
@thosakwe
thosakwe / README.md
Created September 14, 2017 20:33
Frontend language

The idea: Create frontend apps extremely quickly.

It's usually ridiculous tedious to create a frontend, because not only do you have to write code three times, but things like admin panels are very repetitive.

To combat this:

  • Combine HTML and JS together into one file, with extreme sugar to make this very fast to write
  • Just about eliminate CSS necessity by providing components that just work
    • Sacrifice originality for functionality
  • Includes responsive grid - based on flexbox, but progressively enhances