Skip to content

Instantly share code, notes, and snippets.

View flipjs's full-sized avatar
:octocat:
hjkl

Felipe Apostol flipjs

:octocat:
hjkl
View GitHub Profile
angular.module('app', [])
.service('UserService', function($http, $q) {
this.users = []
this.user = {}
function getData(obj, prop, id) {
var q = $q.defer()
var url = '/users/'
$http.get(url + id).success(function(response) {
obj[prop] = response
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Angular App</title>
<!-- SCROLLS -->
<!-- load bootstrap and fontawesome via CDN -->
@flipjs
flipjs / .ackrc
Last active August 29, 2015 14:13 — forked from theaboutbox/.ackrc
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
@flipjs
flipjs / grok_vi.mdown
Last active August 29, 2015 14:14 — forked from nifl/grok_vi.mdown

Answer by Jim Dennis on Stack Overflow question http://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

@flipjs
flipjs / revert.sh
Last active August 29, 2015 14:23 — forked from kugaevsky/revert.sh
$ cd /usr/local
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb
$ brew unlink node
$ brew install node
$ npm install -g npm@latest
  • atom-fuzzy-grep
  • atom-jshint
  • color-picker
  • git-plus
  • highlight-selected
  • minimap
  • minimap-autohide
  • minimap-bookmarks
  • minimap-find-and-replace
  • minimap-git-diff
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.cf:before,
@flipjs
flipjs / cf.less
Last active August 29, 2015 14:25 — forked from geddski/cf.less
/* Micro ClearFix Mixin */
.clearfix{
zoom:1;
&:before, &:after{ content:""; display:table; }
&:after{ clear: both; }
}
@flipjs
flipjs / cf.less
Last active August 29, 2015 14:25 — forked from geddski/cf.less
/* Micro ClearFix Mixin */
.clearfix{
zoom:1;
&:before, &:after{ content:""; display:table; }
&:after{ clear: both; }
}
@mixin clearfix-micro() {
& {
*zoom: 1;
}
&:before,
&:after {
content: "";
display: table;
}
&:after {