Skip to content

Instantly share code, notes, and snippets.

View matthewconstantine's full-sized avatar

Matthew matthewconstantine

  • San Francisco, California
View GitHub Profile
import Ember from 'ember';
const NewPostModalSetup = Ember.Object.extend({
isActive: false,
posts: null,
withOpenModal() {
return NewPostModalSetup.create({
isActive: true
});
▶ nvm ls
v0.10.21
v0.10.22
v0.11.13
v0.12.0
v0.12.7
v4.2.6
-> v5.4.0
system
default -> 4.2.6 (-> v4.2.6)
// Github PR File sorter. Customize the last line as needed. By default it sorts by fileDepth then fileName.
var path = function(el) {
return $(el).find('.user-select-contain').attr('title').replace(/.* → /,'');
}
var directory = function(el) {
return path(el).replace(/.* /,'').replace(/[^\/]*$/,'');
}
var fileName = function(el) {
return path(el).replace(/^.*[\/]_?/, ''); // remove path and preceding _ from file names
}
@matthewconstantine
matthewconstantine / styles.less
Created March 14, 2014 20:58
Atom.io Pulsing Cursor
.item-views .editor.is-focused .cursor {
transition: opacity 400ms ease-in-out;
opacity: 1;
border-width: 0 0 0 2px;
&.blink-off {
opacity: 0;
visibility: visible !important;
}
}
"(blah) blah ) ( blaugh )"
level 1 0 -1 0 -1
left t f f t f
var getBrowserPrefix = memoize(function() {
return keys( document.defaultView.getComputedStyle(document.body, "") )
.join("")
.match(/(?:-(moz|webkit|ms|khtml)-)/);
})
@matthewconstantine
matthewconstantine / gist:2913623
Created June 12, 2012 00:27
My bash_profile aliases
alias cd..="cd .."
alias mspy="lsof | grep '.mp3'"
alias bpro="mate ~/.bash_profile"
alias reload="source ~/.bash_profile;echo reloaded bash_profile"
alias f="open -a Finder ./"
alias l="~/settab"
alias tree="ls -R | grep ':$' | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'"
alias preview="open -a Preview"
alias untar="tar xzvf"
<?xml version="1.0" encoding="UTF-8" ?>
<Module><?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Hello Wave">
<Require feature="wave" />
</ModulePrefs>
<Content type="html">
<![CDATA[
Here's a map from a gist:
<script type="text/javascript" charset="utf-8" src="http://maker.demo.geoiq.com/javascripts/embed.js"></script>
class Scale
def initialize(steps)
@steps = steps
end
# returns the number of half-steps from zero for any degree of a scale
def [](degree)
@steps[degree % @steps.length] + (12*(degree/@steps.length))
end