Skip to content

Instantly share code, notes, and snippets.

Lauro Moraes subversivo58

Block or report user

Report or block subversivo58

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ebidel / feature_detect_es_modules.js
Last active Jan 8, 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


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 Jan 7, 2020
Detect if the browser is running in Private mode (Promise based)
View is-private-mode.js
// uncomment if you are transpiling with Babel + Webpack
// const { window, document } = global;
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise}
* Live demo:
* @see
bendc / supportsES6.js
Created Aug 25, 2016
Test if ES6 is ~fully supported
View supportsES6.js
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
catch (err) {
return false;
View check-if-is-incognito-mode.js
var fs = window.RequestFileSystem || window.webkitRequestFileSystem;
if (!fs) {
result.textContent = "check failed?";
fs(window.TEMPORARY, 100, function(fs) {
console.log('not in incognito mode');
}, function(err) {
console.log('is in incognito mode');
jaredreich / classes.js
Last active Sep 17, 2019
pure javascript add class and remove class functions
View classes.js
var els = document.getElementsByClassName('current-class-name');
removeClass(els, 'current-class-name');
addClass(els, 'new-class-name');
var el = document.getElementById('current-class-name');
removeClass([el], 'current-class-name');
addClass([el], 'new-class-name');
function addClass(elements, className) {
for (var i = 0; i < elements.length; i++) {
adriancooney / nw-js-cookies.js
Created Jul 23, 2015
Quick snippet to display cookie in NW.js (node-webkit) in a sweet console table.
View nw-js-cookies.js
require("nw.gui").Window.get().cookies.getAll({}, console.table.bind(console));
You can’t perform that action at this time.