Skip to content

Instantly share code, notes, and snippets.

Block helper for hbs.

First argument should match the filename of the component (e.g. modal). Anything passed to the component as an attribute will be added to the args object. Content can include any HTML/CSS/JS and even other parials.

Note: Uncomment 'data' in the helper to get access to locals within the component. Otherwise pass any locals to the component as attributes.

@mcky
mcky / secret.py
Created April 14, 2015 23:52
Secret 7"
import os,urllib2
for i in range(1, 701):
imgNum = str(i).zfill(3)
out = os.path.join("/Users/r/Desktop/secret7","img-%s.jpg" % imgNum)
url = "http://d1li66az0g7v6o.cloudfront.net/img/gallery/%s.jpg" % imgNum
page = urllib2.urlopen(url)
open(out,"wb").write(page.read())
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
@mcky
mcky / data.json
Last active August 29, 2015 14:20
{
"text":"project title",
"stakeholders":[
{
"text":"a stakeholder",
"outcomes":[
{
"text":"Another outcome",
"indicators":[
{
var cx = require('bem-classnames')
, Close = require('../Close.jsx')
, ProgressButton = require('./ProgressButton.jsx')
var progressWheel = React.createClass({
render: function() {
var {animate, error, percent, playButton} = this.props
var classes = {
from scrapeMeta import scrapeMeta
import os
import json
from bs4 import BeautifulSoup
import urllib
def getHTML(url):
html = urllib.urlopen(url).read()
return BeautifulSoup(html)
@mcky
mcky / SassMeister-input.scss
Created September 25, 2015 16:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$color: #ff00cc;
.selector {
color: darken($color, 20%);
.nested {
@mcky
mcky / ToggleBtn.js
Last active December 3, 2015 13:01 — forked from sanjaypoyzer/ToggleBtn.js
Toggle this.state.thing
toggleThing: function(thing){
this.setState({
[thing]: !this.state[thing]
})
}
@mcky
mcky / main.scss
Created December 17, 2015 11:27
Specificity override function/mixin
#{specificity('.one', 5)} {
background: purple;
}
@include specificity('.two', 5) {
background: red;
}
/*
* Outputs
@mcky
mcky / mondo.30m.sh
Created February 1, 2016 05:55
mondo bitbar
#!/bin/bash
# Requires:
# - mondo-bank (`npm install mondo-bank -g`)
# - jq (`brew install jq`)
export PATH="/usr/local/bin:/usr/bin/:$PATH";
JSON=$(mondo balance --account_id=YOURID)
BALANCE=$(echo $JSON | jq '.balance' | awk '{print "£"$1/100}')
SPENT=$(echo $JSON | jq '.spend_today' | awk '{print "£"$1/100}')