Skip to content

Instantly share code, notes, and snippets.

View schickm's full-sized avatar

Matt Schick schickm

View GitHub Profile
# Detection
# ---------
hook global BufCreate .*\.(hbs) %{
set buffer filetype handlebars
}
# Highlighters
# ------------
@schickm
schickm / gist:08ec48667a4d43e59d91
Last active September 24, 2017 21:33
Ember Dynamic aliases
import Ember from 'ember';
export default Ember.Object.extend({
model: null,
subpath: null,
dynamicModelProperty: Ember.computed('model', 'subpath', function() {
let subpath = this.get('subpath');
if ( subpath ) {
@schickm
schickm / gist:660e780c4cbcb3126303
Created April 3, 2015 14:49
3 ways of doing the exact same thing
var postsData = [
{
title: 'Introducing Telescope',
url: 'http://sachagreif.com/introducing-telescope/'
},
{
title: 'Meteor',
url: 'http://meteor.com'
},
{
@schickm
schickm / gist:3f1ed15d230f323c1599
Created April 30, 2014 23:46
jQuery: mouseout
$('h2').on('mouseout', function() {
$(this).closest('article').find('.read-more').css({'font-size': '14px'});
});
@schickm
schickm / gist:270ecbd3f1a508737d6a
Created April 30, 2014 23:38
jQuery: changing up the css
<article>
<h2>Yet another headline</h2>
<a class="read-more" href="#">read more...</a>
<div class="more">
<p>Another tasty story...</p>
</div>
</article>
<article>
<h2>Even another headline!!!!</h2>
@schickm
schickm / gist:a51a0cc7075624ff4638
Created April 30, 2014 22:51
jQuery: show content on multiples
<h2>A really intriguing headline!</h2>
<a class="read-more" href="#">read more...</a>
<div class="more">
intrigue:
<ol>
<li>To effect by secret scheming or plotting.</li>
<li>To arouse the interest or curiosity of: Hibernation has long intrigued biologists.
[From French intriguer, to plot, from Italian intrigare, to plot, from Latin intrīcāre, to entangle; see intricate.]</li>
</ol>
@schickm
schickm / gist:f67cede25062992d753c
Last active August 29, 2015 14:00
jQuery: show content on click
<h2>A really intriguing headline!</h2>
<a class="read-more">read more...</a>
<div class="more">
intrigue:
<ol>
<li>To effect by secret scheming or plotting.</li>
<li>To arouse the interest or curiosity of: Hibernation has long intrigued biologists.
[From French intriguer, to plot, from Italian intrigare, to plot, from Latin intrīcāre, to entangle; see intricate.]</li>
</ol>
@schickm
schickm / gist:11266970
Created April 24, 2014 19:40
Javascript: parseFloat
var total = 4 + parseFloat("3.5");
alert(total); // shows "7.5"!
@schickm
schickm / gist:11234442
Created April 23, 2014 22:18
Javascript: parseInt
var total = 4 + parseInt("2");
alert(total); // shows "6" again!
@schickm
schickm / gist:11234345
Created April 23, 2014 22:14
Javascript: adding numbers and strings
var total = 4 + "2";
alert(total); // shows "42"