Skip to content

Instantly share code, notes, and snippets.

Lauro Moraes subversivo58

View GitHub Profile
joshuabaker / languages.json
Created Mar 19, 2020
List of languages with ISO 639-1 Alpha-2 codes in JSON.
View languages.json
"code": "aa",
"name": "Afar",
"native": "Afar"
"code": "ab",
"name": "Abkhazian",
"native": "Аҧсуа"
WesThorburn /
Last active Jul 3, 2020
Webassembly, wasm files, webservers and MIME types

When compiling client files to webassembly, usually you'll end up with both .js and .wasm files. By default, most webservers don't know about the wasm MIME type. You'll likely see the following error: wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.

Here is how to add the wasm MIME type (on linux systems, apache + nginx):

Open /etc/mime.types You'll see two columns, media type on the left, file type on the right Add the line application/wasm wasm

View index.js
const describe = (desc, fn) => {
const it = (msg, fn) => describe(' ' + msg, fn)
const matchers = (exp) => ({
toBe: (asssertion) => {
if (exp === assertion) {
ebidel / feature_detect_es_modules.js
Last active Jun 17, 2020
Feature detect ES modules: both static import and dynamic import()
View feature_detect_es_modules.js
Complete feature detection for ES modules. Covers:
1. Static import: import * from './foo.js';
2. Dynamic import(): import('./foo.js').then(module => {...});
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help.
kenmazaika /
Last active Apr 19, 2019
Showdown Markdown extension

Markdown Extensions for Wells and PrismJS


barretts / css-filter-generator-to-convert-from-base-hex-color-to-target-hex-color.markdown
Last active May 21, 2020
CSS filter generator to convert from black to target hex color
View css-filter-generator-to-convert-from-base-hex-color-to-target-hex-color.markdown
View byepopups.user.js
// ==UserScript==
// @name Byepopups!
// @namespace
// @version 0.001
// @description try to remove all those nasty popups that happen when you click anything in the website! They do suck..
// @author MMTF
// @match *://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
View GithubApiPush.js
//Uses the library under the hood and exposes it as `gh` property
function GithubAPI(auth) {
let repo;
let filesToCommit = [];
let currentBranch = {};
let newCommit = {};
//the underlying library for making requests
let gh = new GitHub(auth);
kousherAlam / server.js
Created Jan 21, 2017
This is a basic node js server, serve the web page,font ,image and video from public folder...
View server.js
const http = require("http"),
fs = require("fs"),
path = require("path"),
log = console.log;
//this will response with file type with specifiq content and encode
function response(res,file,contentType,encode){
if(file != "404"){
jherax / is-private-mode.js
Last active Jul 4, 2020
Detect if the browser is running in Private mode (Promise based)
View is-private-mode.js
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
* Live demo:
* @see
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see
You can’t perform that action at this time.