Skip to content

Instantly share code, notes, and snippets.

View timrourke's full-sized avatar
🇺🇦

Tim Rourke timrourke

🇺🇦
View GitHub Profile
" Use /bin/bash for executing shell commands
set shell=/bin/bash
" Do not save swp files in project
set directory=$HOME/.vim/swapfiles//
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
import Ember from 'ember';
export default Ember.Controller.extend({
field: Ember.computed(function() {
return Ember.Object.create({
fieldCategoryFields: [
Ember.Object.create({
fieldCategory: Ember.Object.create({
name: 'Category 1'
})
@timrourke
timrourke / components.my-component.js
Last active November 17, 2016 02:25
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
foo: 'bar',
init() {
this._super(...arguments);
$('body').on('click', () => {
console.log(this.get('foo')); // works
@timrourke
timrourke / slides.html
Last active April 21, 2017 19:38
Notes for ES6 Talk
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.8.0/styles/gruvbox-dark.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/css/reveal.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/css/theme/night.css">
<style type="text/css">
.reveal .slides {
text-align: left !important;
}
@timrourke
timrourke / controllers.application.js
Last active September 10, 2016 01:46
promise .then chaining
import Ember from 'ember';
const { Promise } = Ember.RSVP;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
import Ember from 'ember';
export default Ember.Controller.extend({
init() {
this._super(...arguments);
let attrs = Ember.keys(this.get('myVal'));
attrs.forEach((attr) => {
attr = "myVal." + attr;
});
@timrourke
timrourke / buildtools.md
Last active August 29, 2015 14:24
Build tools and task runners

The problem

The modern web developer's workflow is growing in complexity. This complexity is the partly the result of a growing ecosystem of codebases, tools and resources created to make writing code faster, cleaner, and less error-prone. In addition, market forces are pushing developers to get more done with less.

The solution to some of these problems can be found in automation. Automation is now a driving force in the development landscape. Using modern development tools, tasks that once took hundreds or thousands of lines of code or several hours of manual work to accomplish can now be reduced to a few terminal commands.

A modern web developer might use a task runner to accomplish the following:

  • Compile CSS into SASS/LESS
  • Check JavaScript files for errors
  • Concatenate all JS or CSS files into one big file for more efficient serving to a browser
@timrourke
timrourke / Gruntfile.js
Created July 7, 2015 10:41
Empty Gruntfile.js
module.exports = function(grunt) {
//This grunt.initCongig() function will wrap our Grunt tasks, and will let us
//define what tasks to run in what order.
grunt.initConfig({
//This line tells our Grunt package to use package.json as the central reference
//for our project.
pkg: grunt.file.readJSON('package.json'),
//We can define each task by using the below syntax.
//Here we define one task called 'sass' that we can run.
@timrourke
timrourke / .vimrc
Created June 17, 2015 18:26
My very first .vimrc file
set nocompatible
filetype off " Required
" Define our bundle plugin block.
" After adding a plugin below, run the following 2 commands and restart vim:
" :source %
" :PluginInstall
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@timrourke
timrourke / srcset-syntax.html
Last active August 29, 2015 14:22
Basic srcset syntax for resolution switching
<img src="http://timrourke.com/content/uploads/2015/06/IMG_3304.jpg"
sizes="100vw"
srcset="http://timrourke.com/content/uploads/2015/06/IMG_3304-320x240.jpg 320w,
http://timrourke.com/content/uploads/2015/06/IMG_3304-640x480.jpg 640w,
http://timrourke.com/content/uploads/2015/06/IMG_3304-1024x768.jpg 1024w,
http://timrourke.com/content/uploads/2015/06/IMG_3304-1280x960.jpg 1280w,
http://timrourke.com/content/uploads/2015/06/IMG_3304-1600x1200.jpg 1600w,
http://timrourke.com/content/uploads/2015/06/IMG_3304-2000x1500.jpg 2000w,
http://timrourke.com/content/uploads/2015/06/IMG_3304.jpg 3264w"
alt="Il Duomo di Siena al tramonto (The Cathedral of Siena at sunset)"