Skip to content

Instantly share code, notes, and snippets.

body {
background-color: #fff;
color: #000;
}
a:active {
opacity: 0.7;
}
.page a.active {
@d-g-h
d-g-h / README.md
Created January 9, 2019 01:56 — forked from teffalump/README.md
OpenWRT adblock implementation

Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:

Description

In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.

//Or TypeScript, with generics:
function delay<T>(millis: number, value?: T): Promise<T> {
return new Promise((resolve) => setTimeout(resolve(value), millis))
}
@d-g-h
d-g-h / init.vim
Last active February 22, 2017 20:54
Current neovim setup
" Plugins {{{
function! VimrcLoadPlugins()
let g:python_host_prog='/usr/local/bin/python'
" Install vim-plug if not available {{{
if !isdirectory(g:vim_plug_dir)
call mkdir(g:vim_plug_dir, 'p')
endif
if !isdirectory(g:vim_plug_dir.'/autoload')
execute '!git clone git://github.com/junegunn/vim-plug '
\ shellescape(g:vim_plug_dir.'/autoload', 1)
@d-g-h
d-g-h / what-forces-layout.md
Created October 13, 2016 17:56 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
FILE: /Users/_dgh/Sell-Media/inc/admin-helpers.php
----------------------------------------------------------------------
FOUND 10 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
----------------------------------------------------------------------
11 | ERROR | [x] Inline control structures are not allowed
39 | ERROR | [ ] Expected 1 space between argument
| | "$original_file" and equals sign; 0 found
39 | ERROR | [ ] Expected 1 space between default value and equals
| | sign for argument "$original_file";
@d-g-h
d-g-h / gist:7863284
Last active December 30, 2015 17:49 — forked from zbal/gist:7800423
Guest Additions for the default Ubuntu box
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
@d-g-h
d-g-h / gist:6297193
Created August 21, 2013 17:09
MYSQL Command for a Wordpress Setup
CREATE DATABASE gpp;
GRANT ALL PRIVILEGES ON gpp.* TO "username"@"localhost" IDENTIFIED BY "password";
FLUSH PRIVILEGES;

tmux shortcuts & cheatsheet

start new:

tmux

attach:

tmux a  #  (or at, or attach)
@d-g-h
d-g-h / TLP.html
Created May 19, 2012 21:49
TLP Site Map
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="author" content="Matt Everson of Astuteo, LLC – http://astuteo.com/slickmap" />
<title>T H E L A S T P E O P L E</title>
<link rel="stylesheet" type="text/css" media="screen, print" href="slickmap.css" />
</head>