Skip to content

Instantly share code, notes, and snippets.

View michaeltroy's full-sized avatar

Michael michaeltroy

  • Newcastle, Australia
View GitHub Profile
# When developing a static website we want to deploy two copies. The
# first is the staging copy and the second is the live production copy.
# The staging copy will be deployed to the following directory:
# 'http://website.com/development/current/index.php'
# The production copy will be deployed to the following directory:
# 'http://website.com/home/current/index.php'
# The directory paths need to be rewritten like so:
$(document).ready(function() {
var el = $('body');
// Removes Tumblr {block} tags while developing.
el.html(el.html().replace(/\{block.*/g, "").replace(/\{[\/]block.*/g, ""));
});
@michaeltroy
michaeltroy / gist:f46bfb7a42926ac80fc8
Last active August 29, 2015 14:02
HTML cheat sheet
<!-- Heading levels -->
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h3>Heading 4</h3>
<!-- Paragraph. -->
<p>This is a paragraph.</p>
<!-- Ordered list. -->
@michaeltroy
michaeltroy / gist:55f735792c23bcec2688
Last active August 29, 2015 14:02
Git cheat sheet

Git cheat sheet

Open the shell from GitHub app.

Steps to do:

  1. Add any new files: git add .
  2. Commit any changes: git commit -m "Write your commit message."
  3. Grab any new changes from anyone else: git pull
  4. Push your new changes: git push
/*
* Require our plugins.
*/
var gulp = require('gulp'),
debug = require('gulp-debug'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
@michaeltroy
michaeltroy / package.json
Last active August 29, 2015 14:02
gulpfile.js
/*
* Require our plugins.
*/
var gulp = require('gulp'),
debug = require('gulp-debug'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
jshint = require('gulp-jshint'),
uglify = require('gulp-uglify'),
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#core_card {
position: absolute;
width: 300px;
height: 300px;
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#mtr_hello_world {
left: 330px;
top: 250px;
position: absolute;
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;