Skip to content

Instantly share code, notes, and snippets.

View tur-nr's full-sized avatar
🦥

Christopher Turner tur-nr

🦥
View GitHub Profile
@tur-nr
tur-nr / package.json
Last active July 30, 2021 23:37
Ethereum Vanity Address
{
"name": "vanity-address",
"main": "vanity.js",
"private": true,
"scripts": {
"start": "node vanity.js"
},
"dependencies": {
"keccak": "^3.0.1",
"randombytes": "^2.0.6",
import React from 'react';
import styled from 'styled-components';
const Text = styled.div`
display: inline-block;
`;
export default Text;
@tur-nr
tur-nr / gist:4bebbbc77c46f6c308a3ef7d1aa4f09e
Last active December 31, 2017 08:32 — forked from milesw/gist:64281684263a315202fd74a681807938
Fix Thai subtitle file encoding
iconv -f ISO_8859-11 -t UTF-8 original.srt > fixed.srt
@tur-nr
tur-nr / bar.js
Created October 10, 2015 04:03
Web Component Lifecycle
(function(window) {
var bar = Object.create(HTMLElement.prototype);
bar.createdCallback = function() {
console.log('x-bar created');
};
bar.attachedCallback = function() {
console.log('x-bar attached');
};
window.BarElement = document.registerElement('x-bar', { prototype: bar });
})(this);
@tur-nr
tur-nr / install.sh
Created April 24, 2014 21:03
Node.js Raspbian Installer
#!/usr/bin/env bash
# Node.js, Raspbian Installer
#
# Author: Chistopher Turner (@tur_nr)
# Site : http://tur-nr.github.io
# var defaults
version="0.10.26" # node.js version
destination="/usr/local/dist/node" # destination location
@tur-nr
tur-nr / .htaccess
Created March 12, 2013 09:21
Force HTTPS protocol.
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/secure/path
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
@tur-nr
tur-nr / .htaccess
Created February 20, 2013 10:57
Forces www sub-domain.
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@tur-nr
tur-nr / .htaccess
Last active December 11, 2015 03:58
Adds a trailing slash to a request.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(\..+)$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]