Skip to content

Instantly share code, notes, and snippets.

View iest's full-sized avatar

Iestyn Williams iest

View GitHub Profile
@iest
iest / CSS-on-beta-pact.md
Last active August 29, 2015 14:27
A draft of a post about topnotes' CSS

TODO:

  • Tools used
    • Webpack
    • CSS modules
    • postcss + plugins used
  • Why it's magic
    • No namespace issues
    • Composability
  • Component-specific styles
@iest
iest / README.md
Last active August 11, 2022 09:20
Setting up environment variables with various shells

What the hell are environment variables?

They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).

With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.

Bash (The default shell on OSX)

Setting for the session:

export function AnimateMixinFactory(stateName) {
var animateMixin = {
getInitialState() {
return {
[stateName]: {}
}
}
};
@iest
iest / gulpfile.js
Created April 28, 2015 11:27
Markdown loader failing with react-hot-loader?
gulp.task('hotreload', function() {
require('./hotLoadServer');
});
@iest
iest / chrome.js
Created February 9, 2015 12:10
Copy all values from iamthefold.com with Chrome
// 1. Load iamthefold.com on Google Chrome
// 2. Open devtools (cmd-option-J on a mac)
// 3. Paste the code below into the console
copy(Array.prototype.slice.call(document.querySelectorAll('li')).map(function(elm){return elm.textContent}))
// 4. Now paste into your favourite text editor!
@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
},
@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)
#!/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'
/**
* 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
*
@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'