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
ebidel / feature_detect_es_modules.js
Last active Jul 21, 2019
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 => {...});
Demo: http://jsbin.com/tilisaledu/1/edit?html,output
Thanks to @_gsathya, @kevincennis, @rauschma, @malyw for the help.
-->
@kenmazaika
kenmazaika / README.md
Last active Apr 19, 2019
Showdown Markdown extension
View README.md

Markdown Extensions for Wells and PrismJS

Hello

foo
```javascript:4,5-7
hello
```
View byepopups.user.js
// ==UserScript==
// @name Byepopups!
// @namespace http://mehmetefeakca.me/
// @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 https://github.com/github-tools/github 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
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"){
res.writeHead(200,{"Content-type":contentType});
if(encode){
@jherax
jherax / is-private-mode.js
Last active Aug 18, 2019
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 http://live.datatables.net/piduzelo/1
*
@bendc
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?";
return;
}
fs(window.TEMPORARY, 100, function(fs) {
console.log('not in incognito mode');
}, function(err) {
console.log('is in incognito mode');
});
@jaredreich
jaredreich / classes.js
Last active Apr 5, 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
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.