Skip to content

Instantly share code, notes, and snippets.

View jonchretien's full-sized avatar
📷

Jon C. jonchretien

📷
View GitHub Profile
define([
'template',
], function(tmpl) {
'use strict';
/*!
* Tooltip Module
* Assumes use of JavaScript templating library.
*
@jonchretien
jonchretien / Makefile
Created February 11, 2014 18:31
Copies local files to Dropbox folder.
# set aliases
DIST = \
~/Dropbox\ \(Company\)/Public/www
DIRS = \
css/ js/ less/
# copy files & directories (exluding lib)
copy:
cp *.html $(DIST)/project-name/
//
// Arrow Mixins
// --------------------------------------------------
.pct-arrow (@dir, @width, @color: @arrow-green) when (@dir = up) {
border-bottom: @width solid @color;
border-left: @width solid transparent;
border-right: @width solid transparent;
}
@jonchretien
jonchretien / _mixins-flexbox.less
Last active August 29, 2015 14:13
Flexbox Mixins
//
// Mixins: Flexbox
// --------------------------------------------------
.flex() {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
@jonchretien
jonchretien / vim-snippets.md
Last active August 29, 2015 14:13
VIM Snippets

Vim Snippets

Jump to line start

  • I ("Insert", editing mode)

Jump to line end

  • $ (non-editing mode)
  • A ("Append", editing mode)

Indent multiple lines

@jonchretien
jonchretien / person.ajs
Last active August 29, 2015 14:17 — forked from tj/person.ajs
// Alternative JavaScript Syntax
Person = :(name, address) { @name!, @address! }
Person::inspect = :{ <: "{@name} lives at {@address}" }
tj := Person('TJ', '314 Bessborough ave')
bob := Person('Bob', 'Some place')
[tj, bob].each(:(person){ print(person.inspect()) })
@jonchretien
jonchretien / notes.md
Last active August 29, 2015 14:18
Notes from OpenVis Conf 2015. Scaffolding generated with https://github.com/jonchretien/conf-notes-template.
<snippet>
<content><![CDATA[
<% $1 %>
]]></content>
<tabTrigger>%</tabTrigger>
<description>ERB Tag</description>
<scope>source.erb</scope>
</snippet>
@jonchretien
jonchretien / index.html
Created November 5, 2015 16:19
Learning React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Spotify Artist Search</title>
<link rel="stylesheet" type="text/css" href="https://developer.spotify.com/web-api/static/css/cached.css">
<style>
body {
padding: 20px;
}
let swapHeaderImage = (() => {
const hero = document.querySelector('.hero');
let current = 1;
let next = 2;
function init() {
hero.classList.remove(Array.from(hero.classList).pop());
hero.classList.add(`artist-banner-${current}`);
}