Skip to content

Instantly share code, notes, and snippets.

@VerteDinde
VerteDinde / index.html
Created September 28, 2023 14:19
Message Port Chrome Repro
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@adrice727
adrice727 / karma.conf.js
Last active April 26, 2024 23:17
karma-webpack => require is not defined
const path = require('path');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config');
module.exports = function (config) {
let sauceLaunchers = {
ie: {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: process.env.BVER === '10' ? 'Windows 8' : 'Windows 8.1',
@iros
iros / application.js
Created November 12, 2011 17:34
BackboneTraining-require.js
// Define whatever global space vars you might need.
var mbta = {
// application configuration parameters
app : {
server : "http://backbonetraining.bocoup.com:8000"
},
// application data
data : {
// station collection
lines : null
@ckzgraphics
ckzgraphics / ChromeOptions_ChromeExtension.js
Last active April 26, 2024 23:16
Add Chrome extension to the Chrome browser in NodeJS + Selenium
var webdriver = require('selenium-webdriver');
var chrome = require("selenium-webdriver/chrome");
var fs = require('fs');
let file_path = '/Users/test/Downloads/Page Ruler.crx';
let buff = new Buffer.from(fs.readFileSync(file_path));
let base64data = buff.toString('base64');
var capabilities = {
@hamik112
hamik112 / dominus.js
Last active April 26, 2024 23:16
Require.js
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.dominus=t()}}(function(){return function t(e,n,r){function o(u,c){if(!n[u]){if(!e[u]){var f="function"==typeof require&&require;if(!c&&f)return f(u,!0);if(i)return i(u,!0);var a=new Error("Cannot find module '"+u+"'");throw a.code="MODULE_NOT_FOUND",a}var s=n[u]={exports:{}};e[u][0].call(s.exports,function(t){var n=e[u][1][t];return o(n?n:t)},s,s.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){(function(n){"use strict";function r(t,e,n,r){return t.addEventListener(e,n,r)}function o(t,e,n){return t.attachEvent("on"+e,a(t,e,n))}function i(t,e,n,r){return t.removeEventListener(e,n,r)}function u(t,e,n){var r=s(t,e,n);return r?t.detachEvent("on"+e,r):void 0}functi
@N0taN3rd
N0taN3rd / chromeCrawling.js
Created May 5, 2017 16:36
use chrome to crawl
const CDP = require('chrome-remote-interface')
const Promise = require('bluebird')
const util = require('util')
const path = require('path')
const fs = require('fs-extra')
const filenameify = require('filenamify-url')
const JsDetector = require('./lib/jsDetector')
const detectLib = require('./lib/detectlibs')
const {apps, categories} = fs.readJsonSync('./lib/apps.json')
@lyoshenka
lyoshenka / search-git-history.md
Last active April 26, 2024 23:16
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@FedericoElles
FedericoElles / fastclick.cdn.ondemand.js
Created March 23, 2016 08:28
Android: Is fastclick.js needed or required?
//Test URL:
// http://ftlabs.github.io/fastclick/examples/layer.html
(function () {
function isNeeded() {
var metaViewport;
var chromeVersion;
// Devices that don't support touch don't need FastClick
@CaptainJiNX
CaptainJiNX / highland-event-debouncer.js
Created February 16, 2017 12:02
From chrome://newtab/
'use strict';
const EventEmitter = require('events').EventEmitter;
const H = require('highland');
const emitter = new EventEmitter();
const delay = ({ key, value }) => {
return H((push, next) => {
H.log('----> REQUEST: ', key, value);
setTimeout(() => {
@Introvertuous
Introvertuous / index.html
Created February 22, 2018 13:29
Headless Chrome Thumbnails
<!DOCTYPE html>
<html>
<body>
<canvas id="canvas" style="width: 1080px; height: 1080px"></canvas>
<script type="text/javascript">
var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
gl.viewportWidth = canvas.width;
gl.viewportHeight = canvas.height;