Skip to content

Instantly share code, notes, and snippets.

@iamphill
iamphill / index.html
Last active October 20, 2015 15:32
Trello shadow DOM
<style>
trello-board {
display: block;
height: 100%;
}
</style>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-latest.js"></script>
<script id="trello-board" type="text/x-handlebars-template">
<style>
trello-list {
@iamphill
iamphill / head.phtml
Last active September 28, 2015 11:56
Magento head
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title><?php echo $this->getTitle(); ?></title>
<meta name="description" content="<?php echo htmlspecialchars( $this->getDescription() ); ?>">
<meta name="keywords" content="<?php echo $this->getKeywords(); ?>">
<?php $_currentProduct = Mage::registry('current_product'); ?>
@iamphill
iamphill / test.css
Created July 21, 2015 06:59
SASS nested namespace properties
#test {
font-family: Helvetica, Arial, sans-serif;
font-size: 2em;
margin-left: 20px;
margin-top: 20px;
padding-right: 50px;
padding-left: 50px; }
@iamphill
iamphill / style.scss
Created May 26, 2015 14:37
SCSS spacing utility
$prefix: space;
// All available sizs
$sizes: (
"n": 0,
"xs": 5px,
"s": 10px,
"m": 15px,
"l": 20px,
"xl": 25px
@iamphill
iamphill / RegexHandler.go
Last active May 9, 2022 02:12
Very basic golang HTTP server
package main
import (
"net/http"
"Regexp"
)
type route struct {
pattern *regexp.Regexp
handler http.Handler
@iamphill
iamphill / .gitconfig
Last active September 24, 2015 08:35
Git config file aliases
[push]
default = simple
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
s = status
@iamphill
iamphill / gulpfile.js
Last active August 29, 2015 14:15
First gulpfile ever made for some awesome-y projects
var gulp = require('gulp'),
sass = require('gulp-sass'),
watch = require('gulp-watch'),
to5 = require('gulp-6to5'),
browserify = require('gulp-browserify'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
runSequence = require('run-sequence');
gulp.task('watch', function () {
@iamphill
iamphill / iphone.css
Created January 21, 2015 15:33
On iPhone, if input font size is below 16px it will automatically zoom in
input {
font-size: 16px;
}
@iamphill
iamphill / Instagram.md
Last active August 29, 2015 14:10
Instagram shadow DOM

Instagram Shadow DOM

This creates a new element instagram-box element which displays 12 recent images with a specific tag.

Taken out of a project due to the polyfill failing in IE9. Works natively in Chrome, needs polyfilled for all other browsers.

@iamphill
iamphill / twitter.md
Last active August 29, 2015 14:08
Access Twitter timeline with JS

https://cdn.syndication.twimg.com/widgets/timelines/[WIDGET URL]?suppress_response_codes=true&callback=?

Create a Twitter embed widget and then take the ID number from URL and swap the [WIDGET URL] with this ID. Then just use as you wish to get access to the data. With jQuery I use..

$.getJSON('https://cdn.syndication.twimg.com/widgets/timelines/[WIDGET URL]?suppress_response_codes=true&callback=?', function (data) {
  var $html = $(d.body)
  // Do something with the return HTML
});