Skip to content

Instantly share code, notes, and snippets.

View edwardgalligan's full-sized avatar

Ed Galligan edwardgalligan

View GitHub Profile
@edwardgalligan
edwardgalligan / prepare-for-github.sh
Created October 5, 2017 13:38
Changing author info without massacring upstream
#!/bin/sh
# vim: set et sw=4 ts=4 ff=unix ft=sh :
git filter-branch --env-filter '
OLD_EMAIL="private@email.com"
CORRECT_NAME="Your Name"
CORRECT_EMAIL="yourname@users.noreply.github.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>TITLE</title>
<style>
html, body, body :not(script) {
display: flex;
flex-direction: column;
@edwardgalligan
edwardgalligan / reactnativealike.css
Last active August 30, 2017 17:24
CSS Reset to make things behave kinda similar to ReactNative
html, body, body :not(script) {
display: flex;
flex-direction: column;
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
height: 100%;
}
<?php
/**
* Quick utility function for dumping the public API of a class
*/
function reflect($obj) {
$refl = new \ReflectionClass($obj);
$ret = array();
foreach($refl->getConstants() as $const => $val) {
$ret[] = '::' . $const->name . ' = ' . $val;
}
@edwardgalligan
edwardgalligan / tog.html
Last active February 10, 2017 01:31
tog ui/ux
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#">
<!-- vim: et ts=4 sw=4 ff=unix ft=html: -->
<head profile="http://gmpg.org/xfn/11">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>Tóg Dublin Hackerspace, DIY, Projects, Electronics, Networking</title>
<link rel="stylesheet" href="/static/css/style.css" />
<link rel="apple-touch-icon" sizes="180x180" href="/static/icons/apple-touch-icon.png"/>
<link rel="icon" type="image/png" href="/static/icons/favicon-32x32.png" sizes="32x32"/>
<link rel="icon" type="image/png" href="/static/icons/favicon-194x194.png" sizes="194x194"/>
@edwardgalligan
edwardgalligan / organicityeu-tag-domains.html
Created December 22, 2016 02:01
Organicity.eu TagDomains
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Data</title>
<style>
html, body, #app {
margin: 0 auto;
padding: 0;
@edwardgalligan
edwardgalligan / CustomProject.php
Last active November 30, 2016 13:51
Old dirty legacy fake namespacing for PHP Sami
<?php
use Sami\Project;
use Sami\Reflection\ClassReflection;
class CustomProject extends Project
{
protected function updateCache(ClassReflection $class)
{
$name = $class->getName();
@edwardgalligan
edwardgalligan / map.html
Created November 21, 2016 22:31
Mapbox GL
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Mapbox GL</title>
<link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.28.0/mapbox-gl.css" />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
@edwardgalligan
edwardgalligan / index.html
Created November 5, 2016 18:09
Chrome Service Worker Link Header
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 0
Link: </serviceworker.js>;rel="serviceworker"
Refresh: 0
matrix-off: about-scheme true
matrix-off: behind-the-scene true
matrix-off: chrome-extension-scheme true
matrix-off: chrome-scheme true
matrix-off: localhost true
matrix-off: opera-scheme true
* * cookie block
* * script block
* 1st-party * allow
* 1st-party script allow