Skip to content

Instantly share code, notes, and snippets.

View subversivo58's full-sized avatar
📧
For critical issues, send me an email

Lauro Moraes subversivo58

📧
For critical issues, send me an email
View GitHub Profile
@mmtftr
mmtftr / byepopups.user.js
Created January 31, 2017 11:37
Byepopups!
// ==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==
//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
Last active September 9, 2023 13:43
This is a basic node js server, serve the web page,font ,image and video from public folder...
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 March 19, 2024 18:29
Detect if the browser is running in Private mode - Promise based (last update: Feb 2020)
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*
@bendc
bendc / supportsES6.js
Created August 25, 2016 08:05
Test if ES6 is ~fully supported
var supportsES6 = function() {
try {
new Function("(a = 0) => a");
return true;
}
catch (err) {
return false;
}
}();
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');
});
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 9, 2024 08:18
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@azu
azu / Medium: remove location hash.user.js
Created December 2, 2015 15:05
Medium: remove location hash
// ==UserScript==
// @name Medium: remove location hash
// @namespace http://efcl.info/
// @description Remove location hash from medium
// @include https://medium.com/*#*
// @version 1
// @grant none
// ==/UserScript==
function removeLocationHash(){
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 3, 2024 06:29
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@adriancooney
adriancooney / nw-js-cookies.js
Created July 23, 2015 17:25
Quick snippet to display cookie in NW.js (node-webkit) in a sweet console table.
require("nw.gui").Window.get().cookies.getAll({}, console.table.bind(console));