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
@rxaviers
rxaviers / gist:7360908
Last active Nov 16, 2019
Complete list of github markdown emoji markup
View gist:7360908

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jherax
jherax / is-private-mode.js
Last active Nov 14, 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
*
@pbojinov
pbojinov / README.md
Last active Nov 11, 2019
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/
View README.md

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@ebidel
ebidel / feature_detect_es_modules.js
Last active Nov 4, 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.
-->
@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){
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);
@justmoon
justmoon / custom-error.js
Last active Sep 21, 2019 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
View custom-error.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@jaredreich
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++) {
@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;
}
}();
@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.