Skip to content

Instantly share code, notes, and snippets.

View EmmanuelOga's full-sized avatar
🏠
Working from home

Emmanuel Oga EmmanuelOga

🏠
Working from home
View GitHub Profile
'use strict';
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('results.json'));
const results = {};
const langs = {};
for (const obj of data.test_metadata) {
@EmmanuelOga
EmmanuelOga / example.output.txt
Last active January 18, 2020 00:48
Gotta find the best! Analyze result.json from https://tfb-status.techempower.com/
$ node analyze.js
fortune
java { fw: 'vertx-postgres', krps: 346 }
java { fw: 'greenlightning', krps: 317 }
java { fw: 'jooby-pgclient', krps: 308 }
java { fw: 'proteus', krps: 266 }
kotlin { fw: 'kooby', krps: 255 }
--
plaintext
java { fw: 'firenio-http-lite', krps: 7010 }
'use strict';
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('results.json'));
const results = {};
const langs = {};
for (const obj of data.test_metadata) {
'use strict';
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('results.json'));
const results = {};
const langs = {};
for (const obj of data.test_metadata) {
@EmmanuelOga
EmmanuelOga / App.java
Created November 5, 2019 07:10
Validate XML with RelaxNG/Jing
package sardina;
import com.thaiopensource.util.PropertyMapBuilder;
import com.thaiopensource.validate.Flag;
import com.thaiopensource.validate.ValidateProperty;
import com.thaiopensource.validate.ValidationDriver;
import com.thaiopensource.validate.prop.rng.RngProperty;
import com.thaiopensource.validate.rng.CompactSchemaReader;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
(defn ival [start finish] [start finish])
(defn mergeTwo [[a0 a1 :as a] [b0 b1 :as b]]
(if (< b0 a0)
(mergeTwo b a)
(if (>= a1 b0)
(list [a0 (max a1 b1)])
(list a b))))
(defn concatMerge [acc ival]
@EmmanuelOga
EmmanuelOga / snake.js
Created April 1, 2019 00:40
badger badger badger badger, SNAAAAAKE, SNAAAKE, OHHHHH, SNAAAAAKE
function snakeval(x, y, w, h, k1, k2) {
return k1 * y + k2 * (h - 1) + x * h;
}
let width = 7;
let height = 12;
let t = document.createElement('table');
for (let y = 0; y < height; y++) {
let row = document.createElement('tr');
@EmmanuelOga
EmmanuelOga / two_triangles.cpp
Last active August 26, 2021 22:12
Draw a couple of triangles: OpenGL Basic GLFW/VAO[VBO] setup.
// Local Headers
#include "glitter.hpp"
// System Headers
#include <glad/glad.h>
#include <GLFW/glfw3.h>
// Standard Headers
#include <iostream>
#include <cstdio>
@EmmanuelOga
EmmanuelOga / CMakeLists.txt
Created April 8, 2017 04:48
CMake: Write include paths to a file (so we can add include paths for visual studio code).
# Write the include paths to a file so we can load it into visual studio code.
# See: https://code.visualstudio.com/docs/languages/cpp#_getting-started
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
file(WRITE "${PROJECT_BINARY_DIR}/includePaths.txt" "")
foreach(dir ${dirs})
file(APPEND "${PROJECT_BINARY_DIR}/includePaths.txt" ${dir})
file(APPEND "${PROJECT_BINARY_DIR}/includePaths.txt" "\n")
endforeach()