Skip to content

Instantly share code, notes, and snippets.

View usingthesystem's full-sized avatar

Markus Müller usingthesystem

View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var domStyle = document.createElement("style");
domStyle.append(
'* { color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }\
* * { background-color: rgba(0,255,0,.2) !important; }\
* * * { background-color: rgba(0,0,255,.2) !important; }\
* * * * { background-color: rgba(255,0,255,.2) !important; }\
* * * * * { background-color: rgba(0,255,255,.2) !important; }\
@usingthesystem
usingthesystem / spinner.js
Created August 17, 2019 05:29 — forked from fritzy/spinner.js
Use Mutation Observers to place image placeholders (spinners) on loading images within a target element.
//whenever uncached images are added to the dom tree within target,
//replace them with a spinner gif until they're loaded
function replaceImages(target, spinner_src) {
var spinner, observer;
//detect support
if (window.MutationObserver) {
//preload spinner (probably a gif)
//if it's not ready for first use, oh well
spinner = new Image();
@usingthesystem
usingthesystem / README.md
Created July 27, 2018 02:48 — forked from obahareth/README.md
GitHub GraphQL API Starred Repositories With Pagination

GitHub GraphQL API Starred Repositories Examples With Pagination

You can play with the GraphQL API live here. It's pretty nice and has autocompletion based on the GraphQL schema.

The first example gets your first 3 starred repos, the cursor values can be used for pagination.

Here's an example response from the first query:

{
@usingthesystem
usingthesystem / MySQL_macOS_Sierra.md
Created May 5, 2018 07:00 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

# A; B Run A and then B, regardless of success of A
# A && B Run B if A succeeded
# A || B Run B if A failed
# A & Run A in background.
@usingthesystem
usingthesystem / flynt-composer.sh
Last active April 5, 2018 18:08
flynt composer packages
composer require "mdsimpson/contact-form-7-to-database-extension"
composer require "wpackagist-plugin/contact-form-7"
composer require "wpackagist-plugin/duplicate-page"
composer require "wpackagist-plugin/duplicate-post"
composer require "wpackagist-plugin/email-address-encoder"
composer require "wpackagist-plugin/enable-media-replace"
composer require "wpackagist-plugin/favicon-by-realfavicongenerator"
composer require "wpackagist-plugin/redirection"
composer require "wpackagist-plugin/regenerate-thumbnails"
composer require "wpackagist-plugin/relevanssi"
@usingthesystem
usingthesystem / .htaccess
Created April 5, 2018 17:36
flynt .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
@usingthesystem
usingthesystem / git-commit-log-stats.md
Created February 17, 2018 03:27 — forked from eyecatchup/git-commit-log-stats.md
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




const puppeteer = require('puppeteer');
//const mkdirp = require('mkdirp');
const fs = require('file-system');
// Put your custom dimension and name Here
const devices = [
{ name: 'Highest', width: 1920, height: 1080 },
{ name: 'Laptop-1', width: 1366, height: 768 },
{ name: 'Laptop-2', width: 1360, height: 768 },
{ name: 'Small-Desktop-1', width: 1280, height: 800 },
@usingthesystem
usingthesystem / index.js
Created September 29, 2017 23:06 — forked from sillysachin/index.js
headless chrome screenshot index
const CDP = require('chrome-remote-interface');
const argv = require('minimist')(process.argv.slice(2));
const file = require('fs');
// CLI Args
const url = argv.url || 'https://www.google.com';
const format = argv.format === 'jpeg' ? 'jpeg' : 'png';
const viewportWidth = argv.viewportWidth || 1440;
const viewportHeight = argv.viewportHeight || 900;
const delay = argv.delay || 0;