Skip to content

Instantly share code, notes, and snippets.

@abovethewater
abovethewater / add_utf8_encoding.js
Last active Apr 15, 2020
Quick proxy to illustrate the use of the content-type to fix extra characters in non utf-8 encoding of Copyright ©
View add_utf8_encoding.js
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 Jul 22, 2014
Workaround bower not supporting no_proxy
View bower_no_proxy_install.sh
#!/bin/sh
bower install
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
export http_proxy=
bower install
RETVAL=$?
fi
View force-ssl-url-scheme.php
<?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 Oct 7, 2015
Enabling bracket matching without auto closing brackets in atom
View init.coffee
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 Dec 17, 2015 — 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.
View index.html
<!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 Dec 17, 2015 — 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)
View index.html
<!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 Mar 6, 2012 — forked from luciferous/node-jsmockito.sh
JSHamcrest 0.6.7 - Use JsMockito with NodeJS (patched for CommonJS Module 1.1 compliance)
View node-jsmockito.sh
#!/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 \