Skip to content

Instantly share code, notes, and snippets.

View wesbos's full-sized avatar
🔥
SLAYING BUGS

Wes Bos wesbos

🔥
SLAYING BUGS
View GitHub Profile
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const javascript = {
test: /\.(js)$/,
use: [{
loader: 'babel-loader',
options: { presets: ['es2015'] }
}],
// 1. Visit a news website like cnn.com
// 2. paste this into your console
setInterval(() =>
document.querySelectorAll('p,img,a,button,h1,h2,h3,span')
.forEach(x=>x.style=`transform:rotate(${Math.random()*777}deg) scale(${Math.random()* 3}); transition:all .5s`)
, 500);
// 3. feel a lil bit better 😘
@wesbos
wesbos / gist:d7877929def4368cdb8abc12c5d3e38b
Last active September 9, 2020 15:21
"Out Of Office" Filter
Trying to filter "out of office" emails from my inbox as I receive a lot of them when I send a blast.
I need help - what do your "out of office" emails say in your langauge? Comment Below!
## Gmail Filter
("Automatische Antwort" OR "Automatic reply" OR "AutoReply" OR "Out of Office" OR "Xesc Duran" OR "Abwesend" OR "Absence" OR "Absence du bureau" OR "À l'extérieur du bureau" OR "Réponse automatique" OR "Abwesenheitsnotiz" OR "Resposta automática" OR "Automaattinen vastaus" OR "Automatisch antwoord" OR "Afwezig" OR "Afwezigheid" OR "Niet aanwezig" OR "Poza zasięgiem" OR "Na wakacjach" OR "Poza biurem" OR "Automatyczna odpowiedź" OR "Z dala od komputera" OR "Αυτόματη απάντηση" OR "Εκτός γραφείου" OR "na dovolenké" OR "mimo kancelárie" OR "automatická odpověď" OR "Autosvar" OR "Fora do escritório" OR "na dovolené" OR "mimo kancelář")
## List
Automatische Antwort
Automatic reply
@wesbos
wesbos / commit-msg
Created July 4, 2016 18:55
ESLint 3.0 Git Pre Commit Hook
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.jsx\?$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
failed=0
for file in ${files}; do
@wesbos
wesbos / wow.html
Created June 23, 2016 19:10
CSS spring() transition timing function
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Spring</title>
</head>
<body>
<img src="https://logo.clearbit.com/wesbos.com" class="person person1">
<img src="https://logo.clearbit.com/paulirish.com" class="person person2">
<img src="https://logo.clearbit.com/addyosmani.com" class="person person3">
[...document.querySelectorAll('.invite-card')].forEach(card => {
const headline = card.querySelector('.headline').textContent;
const accept = card.querySelector('.bt-invite-accept');
const decline = card.querySelector('.bt-invite-decline');
const name = card.querySelector('.name').textContent;
if(headline.match(/recruit/gi)) {
console.log(`Nah. ${name} looks a little fishy to me. 🚷🚷🚷`);
decline.click();
} else {
# Put this in your .zshrc or .bashrc file
# Install `tree` first — brew install tree
function t() {
# Defaults to 3 levels deep, do more with `t 5` or `t 1`
# pass additional args after
tree -I '.git|node_modules|bower_components|.DS_Store' --dirsfirst --filelimit 15 -L ${1:-3} -aC $2
}
@wesbos
wesbos / gist:0d5572a29e4f5688a1c8
Last active September 1, 2023 17:59
Handy list of widths to target in a responsive website
320
321
322
323
324
325
326
327
328
329
var gulp = require('gulp'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
autoprefixer = require('gulp-autoprefixer'),
concat = require('gulp-concat'),
imageMin = require('gulp-imagemin'),
minifyCSS = require('gulp-minify-css'),
notify = require('gulp-notify'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
sudo curl -o /usr/local/bin/imgcat -O https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat && sudo chmod +x /usr/local/bin/imgcat
# If you have a better way to fix the permissions, comment below!