Skip to content

Instantly share code, notes, and snippets.

View hatched's full-sized avatar

Jeff Pihach hatched

View GitHub Profile
@hatched
hatched / fix-blur.css
Created April 1, 2016 04:08
Fix for new preact website menu blurry fonts
.header_3fP58 nav section>nav {
transform: translateX(-50%) skew(0deg, 0deg);
}
@hatched
hatched / named-params.js
Created February 29, 2016 21:55
Named params
function foo({bar=0} = {}) {
console.log(bar)
}
foo({bar: 7}) // 7
foo() // 0
foo(true) // 0
@hatched
hatched / gist:2dc93eddbcdc9a2c9974
Last active August 29, 2015 14:21
How to use the dev version of the Juju GUI
cd ~
mkdir -p charms/trusty
cd charms/trusty
bzr branch lp:~juju-gui/charms/trusty/juju-gui/trunk juju-gui
cd ../
juju bootstrap
juju deploy --repository=. local:trusty/juju-gui
juju set juju-gui juju-gui-source=develop
serviceAttrs = Y.mix({
id: 'mediawiki',
charm: charmId,
exposed: false,
upgrade_available: true,
upgrade_to: 'cs:precise/mediawiki-15'
}, serviceAttrs, true, null, 0, true);
commit 01a5436b73538edbb9537a6db318ac176dec2caa
Author: Jeff Pihach <[email protected]>
Date: Wed Jul 9 09:43:53 2014 -0600
Adding manually placed units calls env add_unit method
diff --git a/app/templates/scale-up.handlebars b/app/templates/scale-up.handlebars
index 6ad5de0..740caa7 100644
--- a/app/templates/scale-up.handlebars
+++ b/app/templates/scale-up.handlebars
@hatched
hatched / usage.js
Last active August 29, 2015 14:03
runWhenCalled
it('opens the options with the correct constraints details', function(done) {
// It shouldn't show constraints details if the manual placement radio
// is selected.
var toggleScaleUp = utils.makeStubMethod(View.prototype, '_toggleScaleUp');
this._cleanups.push(toggleScaleUp.reset);
var toggleConstraints = utils.makeStubMethod(
View.prototype, '_toggleConstraints');
this._cleanups.push(toggleConstraints.reset);
instantiateView(this).render();
@hatched
hatched / diff.diff
Created June 19, 2014 21:41
fix failing test-prod kadams54-unit-constraints
diff --git a/app/widgets/create-machine-view.js b/app/widgets/create-machine-view.js
index ff6d965..9a9961b 100644
--- a/app/widgets/create-machine-view.js
+++ b/app/widgets/create-machine-view.js
@@ -93,8 +93,13 @@ YUI.add('create-machine-view', function(Y) {
*/
_handleContainerTypeChange: function(e) {
e.preventDefault();
- var constraints = this.get('container').one('.constraints'),
- newVal = e.target.one('option:checked').get('value');

Keybase proof

I hereby claim:

  • I am hatched on github.
  • I am hatch (https://keybase.io/hatch) on keybase.
  • I have a public key whose fingerprint is 7BE1 5E29 6AD9 1AC2 D120 BC84 442D B272 F77D E75E

To claim this, I am signing this object:

@hatched
hatched / santa.js
Created December 9, 2013 15:18
Javascript solution to the Secret Santa Dart Dare: https://plus.google.com/u/0/118397406534237711570/posts/XjgFRvqtVA4 ""Your Dart program must take a list of people (first name, last name) and return pairs of Secret Santas. A person can't be their own santa, and a person can't be a santa for someone with the same last name.""
var people = [
'Zoe Washburne',
'Hoban Washburne',
'Malcolm Reynolds',
'Simon Tam',
'River Tam',
'Buffy Summers',
'Dawn Summers'
];
@hatched
hatched / gist:7826871
Created December 6, 2013 15:45
Show git branch information in the prompt
export PS1='\u@\h:\w `git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`\[\033[37m\]:'