Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
# First, we need to find our device. BEFORE inserting your USB drive, run the | |
# following: | |
diskutil list | |
# This will output a bunch of info about all of the disk drives connected to | |
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is | |
# some number starting at 0. Now, insert your USB drive and run the command | |
# again. You should see a new entry. Make note of the name (ie, /dev/diskX). | |
diskutil list |
#!/usr/bin/env python | |
# This requires Python 2.7. This will not work with Python 3 | |
# Thanks to PaulW for the idea. In this case it was a matter of using | |
# the Ff Inspector Netwroks analyser to log the interactive query with | |
# "Persistent Logs" enabled, dumping the HAR to to pick out the key | |
# queries and with a bit of trial and error to refine them. | |
# | |
# I run this daily as a cron job. |
func buildEmailInput(source, destination, subject, message string, | |
csvFile []byte) (*ses.SendRawEmailInput, error) { | |
buf := new(bytes.Buffer) | |
writer := multipart.NewWriter(buf) | |
// email main header: | |
h := make(textproto.MIMEHeader) | |
h.Set("From", source) |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
Handy helpers for controlling visibility of elements until Vue has compiled.
Use like:
<div v-cloak>
<h1>
<span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
<span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
#!/usr/bin/env powershell | |
<# | |
.SYNOPSIS | |
You can use this script to easly transform any XML file using XDT. | |
To use this script you can just save it locally and execute it. The script | |
will download its dependencies automatically. | |
Created by sayediHashimi | |
Modified by obscurerichard | |
Thanks Stack Overflow: https://stackoverflow.com/questions/8989737/web-config-transforms-outside-of-microsoft-msbuild |
func openbrowser(url string) { | |
var err error | |
switch runtime.GOOS { | |
case "linux": | |
err = exec.Command("xdg-open", url).Start() | |
case "windows": | |
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() | |
case "darwin": | |
err = exec.Command("open", url).Start() |
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
var ncr = require('nodecr') | |
, request = require('request') | |
, fs = require('fs') | |
, test_img = 'https://www.google.com/images/srpr/logo3w.png' // Change this to your image | |
// Create image name from end of URL. | |
// Note this will fail in loads of cases. | |
var imgName = test_img.split('/').pop() | |
// Process the image and read the text from it using Tesseract |