To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
// This is the coolest code snippet I (Mr. Mad) have every created | |
// It will magicly get the size of a textnode, by createing a context | |
// range and get the client rects of that range. | |
// It will then combine the rects to one rect, and thereby get the size | |
// of the text node. | |
// Note that by any standarts a TextNode has no size. | |
var range = document.createRange(); | |
range.selectNode(node); | |
var rect = range.getBoundingClientRect(); |
Function Check-Spelling() | |
{ | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$True,Position=0,ValueFromPipeline=$True)] | |
[String] $String, | |
[Switch] $ShowErrors, | |
[Switch] $RemoveSpecialChars | |
) | |
Process{ |
/* To use this in a Google Sheet: | |
1. Go to Tools > Script Editor. | |
2. Save the script. | |
3. Paste this script and click on the bug symbol. | |
4. Authorize the script. | |
5. Refresh the sheet. | |
*/ | |
// global | |
var ss = SpreadsheetApp.getActive(); |
/* Pre-requisite | |
================== | |
1) Create an Environment (if you don't already have on) and enable it for your request | |
2) Add a new Header with key as "Authorization" and value as "{{hmacAuthHeader}}" | |
3) Add the following Pre-request Script that computes the hmacAuthHeader variable and adds it to the environment | |
4) Fill your CLIENT_KEY and SECRET_KEY with valid values | |
*/ | |
function getPath(url) { | |
var pathRegex = /.+?\:\/\/.+?(\/.+?)(?:#|\?|$)/; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>WebWorker image preloading</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> | |
</head> | |
<body> | |
<div id="output"></div> | |
<script id="imgloader" type="javascript/worker"> | |
// Not race proof or robust. Proof of concept. |
<html> | |
<head> | |
<style> | |
figure { | |
width: 200px; | |
height: 150px; | |
text-align: center; | |
float: left; | |
} | |
img { |
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
<!-- image --> | |
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}> | |
{{ with .Get "link"}}<a href="{{.}}">{{ end }} | |
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }} class="lazyload" /> | |
<noscript> | |
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }}/> | |
</noscript> | |
{{ if .Get "link"}}</a>{{ end }} | |
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} | |
<figcaption>{{ if isset .Params "title" }} |
#cloud-config | |
package_upgrade: true | |
packages: | |
- curl | |
- ntp | |
- wget | |
- git | |
- vim | |
users: | |
- name: mhutter |