Skip to content

Instantly share code, notes, and snippets.

View Bockit's full-sized avatar

James Hiscock Bockit

  • Sydney, Australia
View GitHub Profile
@Bockit
Bockit / components.click-me.js
Created February 22, 2018 02:38
House of the Rising Sun
import Ember from 'ember';
export default Ember.Component.extend({
});
@Bockit
Bockit / application.controller.js
Last active September 4, 2017 05:48
Code Formatting
import Ember from 'ember';
import primitiveBar from '../snippets/primitives/primitive-bar'
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
primitiveBar: primitiveBar
});
@Bockit
Bockit / components.my-book.js
Last active August 26, 2017 01:03
component-semantics-test
import Ember from 'ember';
export default Ember.Component.extend({
willRender() {
console.log('rendered!')
},
click() {
this.get('select')()
},
@Bockit
Bockit / a.js
Created October 29, 2013 03:16
If two files have the same contents browserify is aliasing one file to the other file, which causes some function equality issues. This is my isolated example.
module.exports = function() {
console.log('I am a function');
}
@Bockit
Bockit / Embed.html
Last active December 21, 2015 10:09
Embed code and postie.js It's important that the iframe comes before the script tags. jQuery must be on the page. If it isn't, you'll need to add it. If you change the id or name of the frame, keep both the same. Also, make sure to update the strings in the JavaScript. You can find the script 'postie.js' on this page as well. Also, CORS needs to…
<iframe src="http://sasha-project.s3.amazonaws.com/afr-prod/projects/politics/index.html" frameBorder="0" id="elec-frame" name="elec-frame" style="display:block; width:100%"></iframe>
<script src="js/postie.js"></script>
<script>
var $frame = $('#elec-frame')
var postie = new Postie(window.frames['elec-frame'], $frame.attr('src'))
postie.on('change:height', function(height) { $frame.height(height) })
postie.on('change:hash', function(hash) { window.location.hash = hash })
postie.on('set:scroll', function(size) {
scrollTop = size.top - ($(window).height() - size.height) / 2
@Bockit
Bockit / gist:6118997
Created July 31, 2013 03:10
TSV to CSV, easy enough to make it go the other way too
csv.writer(file('data/asylum/asylumseekers_global.csv', 'w+'), delimiter=',').writerows(csv.reader(open("data/asylum/asylumseekers_global.tsv", 'Ur+'), delimiter='\t'))
@Bockit
Bockit / synclabels.py
Last active December 18, 2015 13:59
Simple script to sync labels to any repository. Usage: python synclabels.py owner/repo
import argparse
from getpass import getuser, getpass
from github3 import GitHub
user = raw_input('GitHub username: ')
password = ''
while not password:
password = getpass('Password for %s: ' % user)
# Only compile sass per request by default, compiling requirejs is too heavy
PIPELINE_COMPILERS = (
'pipeline.compilers.sass.SASSCompiler',
)
# Path to your sass binary and any extra arguments you want to add
# We add compass to get access to their wonderful sass extentions
PIPELINE_SASS_BINARY = '/usr/bin/sass'
PIPELINE_SASS_ARGUMENTS = '--compass'
# Dict of discreet CSS files to have
# Only compile sass per request by default, compiling requirejs is too heavy
PIPELINE_COMPILERS = (
'pipeline.compilers.sass.SASSCompiler',
)
# Path to your sass binary and any extra arguments you want to add
# We add compass to get access to their wonderful sass extentions
PIPELINE_SASS_BINARY = '/usr/bin/sass'
PIPELINE_SASS_ARGUMENTS = '--compass'
# Dict of discreet CSS files to have
@Bockit
Bockit / SassMeister-input.scss
Created October 21, 2015 04:22
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
.full-screen-nav {
font-size: 12px;
// .full-screen-nav-inner
&-inner {
font-size: 12px;