Skip to content

Instantly share code, notes, and snippets.

@benjaminwy
benjaminwy / setup-dnsmasq.sh
Created August 23, 2024 16:06 — forked from archan937/setup-dnsmasq.sh
Point *.test to 127.0.0.1 using DNSMasq and NetworkManager on Ubuntu
#!/bin/bash
# Usage:
#
# curl -sL https://gist.githubusercontent.com/archan937/d35deef3b1f2b5522dd4b8f397038d27/raw/setup-dnsmasq.sh | sudo bash
#
DOMAIN=".test"
ensure_ping() {
// Step 1: Inject jQuery
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// Step 2: Grab IDs. Will need to be updated when Mailchimp changes their markup.
var groups = [];
$('div.group-wrapper h4').each(function() {
var g = {
name: $(this).text(),
@benjaminwy
benjaminwy / caption-overlay.css
Last active September 9, 2015 01:05
Scent caption overlay effect
/* Turn the background image grayscale; doesn't work in old versions of IE */
#page-55ce14b0e4b033a227a7cb0e div.sqs-block.image-block.sqs-block-image:hover img.thumb-image.loaded {
-webkit-filter: grayscale(1);
filter: gray;
filter: grayscale(1);
filter: url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' height='0'><filter id='greyscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0' /></filter></svg>#greyscale");
transition: all ease-in-out .25s;
-webkit-transition: all ease-in-out .25s;
-moz-transition: all ease-in-out .25s;
}
@benjaminwy
benjaminwy / .gitconfig
Last active August 29, 2015 14:16
Useful git aliases
[user]
name = Your Name
email = your.email@address.com
[alias]
# List aliases
la = "!git config -l | grep alias | cut -c 7-"
# Shorthand
c = commit -m