A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
/* | |
This is a real simple pattern that allows you to | |
maintain a syntax similar to classnames, but use | |
CSS Module mode in webpack. | |
(solving the problem of cleanly using object properies as keys) | |
*/ | |
function use(result, conditions){ | |
/* |
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
try { | |
eval(str); | |
} catch(e) { | |
alert('Your browser does not support ES6!') | |
} |
#!/bin/bash | |
for file in $(git diff --cached --name-only | grep -E '\.(js|jsx)$') | |
do | |
git show ":$file" | node_modules/.bin/eslint --stdin --stdin-filename "$file" # we only want to lint the staged changes, not any un-staged changes | |
if [ $? -ne 0 ]; then | |
echo "ESLint failed on staged file '$file'. Please check your code and try again. You can run ESLint manually via npm run eslint." | |
exit 1 # exit with failure status | |
fi | |
done |
//npm i gulp gulp-stylus gulp-plumber browser-sync bs-fullscreen-message | |
var gulp = require('gulp'); | |
var stylus = require('gulp-stylus'); | |
var plumber = require('gulp-plumber'); | |
var browserSync = require('browser-sync').create(); | |
//Enable "Fullscreen Messages" plugin in Browsersync Plugins web settings (http://localhost:3001/plugins) | |
//Notification template | |
var bsError = function(data) { |
#!/usr/bin/env sh | |
tweetbot_running() { | |
ps x | grep -v grep | grep Tweetbot > /dev/null | |
} | |
clean_tweetbot_cache() { | |
rm -rf ~/Library/Containers/com.tapbots.TweetbotMac/Data/Library/Caches/com.tapbots.TweetbotMac | |
} |
// to get the current latitude and longitude from browser | |
// credits https://github.com/arunisrael/angularjs-geolocation | |
'use strict'; | |
angular.module('geolocation',[]).constant('geolocation_msgs', { | |
'errors.location.unsupportedBrowser':'Browser does not support location services', | |
'errors.location.notFound':'Unable to determine your location', | |
}); | |
angular.module('geolocation') |
#!/bin/sh | |
# | |
# chkconfig: 35 99 99 | |
# description: Node.js /home/nodejs/sample/app.js | |
# | |
. /etc/rc.d/init.d/functions | |
USER="nodejs" |