Skip to content

Instantly share code, notes, and snippets.

View iest's full-sized avatar

Iestyn Williams iest

View GitHub Profile
@iest
iest / jquery to vanilla.md
Last active December 14, 2015 05:58 — forked from liamcurry/gist:2597326
Snippets to help the transition from jQuery to vanilla. Vanilla is generally more verbose than jQuery, but is up to a million billion faster.

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@iest
iest / opacity.styl
Last active December 17, 2015 07:49
Supporting old IE with Stylus: opacity edition
opacity(amount)
opacity amount
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)" % (amount * 100);
// Just use opacity as you normally would in your stylus, and get support for IE8!
Error processing request
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at core.http.RoutesHandler.channelRead0(RoutesHandler.java:161)
at core.http.RoutesHandler.channelRead0(RoutesHandler.java:47)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98)
at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:334)
{
"generatorsetup": {
"_id": "524e96b7ef86a4744ecc806c",
"name": "Iest test",
"catalogueId": "523314fc1c264d2131cbe7df",
"type": "ADWORDS",
"grouping": "",
"fields": {
"campaign": "",
"adgroup": "",
setupController: function(controller, model) {
var report;
if (Ember.typeOf(model) === 'instance') {
report = model;
} else {
var title = this.get('routeName').split('.')[1];
@iest
iest / config.fish
Created February 18, 2014 16:50
My Fish config
# Turn off greeting
set fish_greeting ""
# Aliases
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gl='git log'
alias gpr='git pull-request'
alias cpwd='pwd | pbcopy'
/**
* Changes effective as of v1.2-2014-g59824b3
*
* Update Holistic's CMS MongoDB schema to reflect API changes.
*
* 1. Remove leading slashes from the `relativePath`s of all pages
* 2. Replace template ObjectIDs stored on the page with the template file name.
* 3. Drops the `simpleCmsTemplates` collection.
* 4. Recursively add `absolutePath`s to all pages
*
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@iest
iest / gulpfile.js
Last active August 29, 2015 14:10
Another reason why React is awesome: render components directly inside your style guide, passing in props
gulp.task('styleguide', ['build'], function() {
var React = require('react');
require('node-jsx').install();
var p = require('path');
var components = {};
// This is the important bit
var normalizedPath = p.join(__dirname, "src/components/");
require("fs").readdirSync(normalizedPath)
@iest
iest / BzIframe.js
Created January 7, 2015 16:43
Basic react iframe with onLoad handler
'use strict';
var React = require('react');
var BzIframe = React.createClass({
propTypes: {
src: React.PropTypes.string.isRequired,
onLoad: React.PropTypes.func
},