Skip to content

Instantly share code, notes, and snippets.

@abovethewater
abovethewater / add_utf8_encoding.js
Last active April 15, 2020 14:32
Quick proxy to illustrate the use of the content-type to fix extra characters in non utf-8 encoding of Copyright ©
const http = require('http')
const httpProxy = require('http-proxy')
const options = {
target: 'https://free.co.uk'
}
const proxy = httpProxy.createProxyServer({
secure: false,
changeOrigin: true,
@abovethewater
abovethewater / bower_no_proxy_install.sh
Created July 22, 2014 20:47
Workaround bower not supporting no_proxy
#!/bin/sh
bower install
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
export http_proxy=
bower install
RETVAL=$?
fi
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI: http://www.webaware.com.au/
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility
@abovethewater
abovethewater / init.coffee
Last active October 7, 2015 14:34
Enabling bracket matching without auto closing brackets in atom
BracketMatcherView = require '/Applications/Atom.app/Contents/Resources/app/node_modules/bracket-matcher/lib/bracket-matcher-view.js'
atom.workspaceView.eachEditorView (editorView) =>
if editorView.attached and editorView.getPane()?
new BracketMatcherView(editorView)
@abovethewater
abovethewater / index.html
Last active December 17, 2015 10:59 — forked from crofty/index.html
An example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet Forked from https://gist.github.com/crofty/2197701, updated to use latest leaflet from CDN - Issues with markers moving first when zooming.
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.5/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="https://gist.github.com/bencevans/4504864/raw/c9ef880071f959398b7cf0b687d4f37c352ea86d/leaflet-google.js"></script>
</head>
<body>
@abovethewater
abovethewater / index.html
Last active December 17, 2015 10:49 — forked from crofty/index.html
An example of using Google Map tiles with the Leaflet mapping library - http://matchingnotes.com/using-google-map-tiles-with-leaflet Forked from https://gist.github.com/crofty/2197701, updated to use leaflet CDN (fixes 403 forbidden)
<!DOCTYPE html>
<html>
<head>
<title>Leaflet</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="https://raw.github.com/gist/2197042/2b90c41b39b7d5b3a851d8f256de2ebd3fe1fb74/leaflet-google.js"></script>
</head>
<body>
@abovethewater
abovethewater / node-jsmockito.sh
Created March 6, 2012 08:16 — forked from luciferous/node-jsmockito.sh
JSHamcrest 0.6.7 - Use JsMockito with NodeJS (patched for CommonJS Module 1.1 compliance)
#!/bin/sh
# JsHamcrest v0.6.7 && JsMockito v1.0.4
# Begin with an empty file.
echo > mockito.js
# Download and concatenate jshamcrest with jsmockito.
curl --silent --compressed \
http://jshamcrest.destaquenet.com/jshamcrest.js \
http://cloud.github.com/downloads/chrisleishman/jsmockito/jsmockito-1.0.4.js \