Skip to content

Instantly share code, notes, and snippets.

View Kerrick's full-sized avatar

Kerrick Long Kerrick

View GitHub Profile
@Kerrick
Kerrick / gotta-clone-them-all.rb
Created March 19, 2013 01:19
gotta-clone-them-all, to clone all the github repositories of a user
#!/usr/bin/env ruby
# gotta-clone-them-all, to clone all the github repositories of a user
# Copyright (C) 2013 Kerrick Long
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@Kerrick
Kerrick / Starting on the Server.sh
Created April 27, 2012 03:34
Create a new website and deploy it via Git
# On the server
# Assuming the site is served from ~/www/example.com/ and you can hide the .git directory from public view
# Keep in mind that ^D is Control-D, or what ever the command is for your shell to stop input.
mkdir ~/www/example.com && cd ~/www/example.com
git init
git config core.worktree ~/www/example.com
git config receive.denycurrentbranch ignore
cat > .git/hooks/post-receive
#!/bin/sh
git checkout -f
@Kerrick
Kerrick / application.controller.js
Created March 23, 2016 18:27
Dirty Property Test Case
import Ember from 'ember';
export default Ember.Controller.extend({
});
@Kerrick
Kerrick / components.my-component.js
Last active April 25, 2016 21:07
Yielded Block Spacing Issues
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
@Kerrick
Kerrick / components.show-hide-trigger.js
Created September 14, 2016 16:41
isVisible Changes `display` without removing from DOM
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
const FooMixin = Ember.Mixin.create({
foo() {
alert('foo');
}
});
const obj = Ember.Object.extend(FooMixin).create();
@Kerrick
Kerrick / components.item-viewer.js
Last active December 15, 2016 23:08
Reduced Test Case - Reset State
import Ember from 'ember';
export default Ember.Component.extend({
value: false,
actions: {
toggle() {
this.toggleProperty('value');
}
}
});
@Kerrick
Kerrick / components.my-component.js
Created January 12, 2017 20:17
Adding Dynamic Class Names
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['gets-classes-added'],
actions: {
addClass() {
const newClass = Math.random().toString().slice(2);
this.get('classNames').addObject(newClass);
}
}
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['gets-classes-added'],
classNameBindings: ['extraClassNames'],
setupExtraClasses: Ember.on('init', function() {
this.set('extraClasses', []);
}),
extraClassNames: Ember.computed('extraClasses', function() {
return this.get('extraClasses').join(' ');
import Ember from 'ember';
export default Ember.Controller.extend({
firstName: '',
lastName: '',
fullName: Ember.computed('firstName', 'lastName', function() {
const firstName = this.get('firstName');
const lastName = this.get('lastName');
if (firstName && lastName) {