This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// doesn't work | |
App.ApplicationView = Ember.View.extend({ | |
didInsertElement: function() { | |
$(document).foundation(); | |
} | |
}); | |
// works | |
App.ApplicationView = Ember.View.extend({ | |
didInsertElement: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// HTML | |
// | |
<html> | |
<head></head> | |
<body class="loading"></body> | |
</html> | |
// | |
// Template (layout.hbr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// CanJS jQuery.fn.control | |
// | |
// http://canjs.com/docs/jQuery.fn.control.html | |
// | |
// The jQuery.fn.control method do not appear to work with string parameter | |
// | |
// | |
// Define Plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Whiteboard cleaner: http://ipestov.com/one-cool-gist-whiteboardcleaner/ | |
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Component = Vue.extend({ | |
template: "<div>Hello world</div>", | |
data: function () { | |
console.log('Component data()'); | |
return {}; | |
}, | |
ready: function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function test(a = foo(arguments)) { | |
console.log(a, typeof a); | |
} | |
function foo(args) { | |
console.log('foo', args) | |
} | |
console.log(test(undefined, undefined, undefined)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Enforcing strict routing | |
https://github.com/expressjs/express/issues/2281 | |
Use cases: | |
GET /strict -> noslash | |
GET /strict/ -> noslash (expect slash) | |
GET /strict// -> noslash (expect 404) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div style="display: flex; flex-direction: column; min-height: 100vh; "> | |
<div style="flex-shrink: 0; overflow: auto;"> | |
HEADER | |
</div> | |
<div style="flex-shrink: 0; overflow: auto;"> | |
<div style="margin: 0 auto; align-self: center; overflow: auto; max-width: 420px; padding: 1rem 2rem; border-radius: 0.5rem; background: #eee;"> | |
BANNER | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/a/3143485/2424549 | |
# create a new branch | |
git checkout -b new_clean_branch | |
# apply all changes | |
git merge original_messy_branch | |
# forget the commits but have the changes staged for commit | |
git reset --soft master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
* { | |
margin: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div style="display: flex; flex-direction: column; min-height: 100vh;"> |
OlderNewer