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
@flipjs
flipjs / gist:35147cbc249d6003bcae
Created October 17, 2014 00:45
Install macvim with python (if for some reason brew wont install with python)
cd /System/Library/Frameworks/Python.framework/Versions
sudo mv Current Current-sys
sudo ln -s /usr/local/Cellar/python/2.8.x/Frameworks/Python.framework/Versions/2.7 Current
brew install macvim
sudo mv Current Current-brew
sudo mv Current-sys Current
@flipjs
flipjs / gist:8b263c3a6a6485bf0e07
Created December 29, 2014 00:34
Advice on NOT using semicolons in Javascript
"If you choose to omit semicolons where possible, my advice is to insert them immediately before the opening parenthesis or square bracket in any statement that begins with one of those tokens, or any which begins with one of the arithmetic operator tokens /, +, or - if you should happen to write such a statement." - Michael John Clement
@flipjs
flipjs / country-state.json
Created January 16, 2015 18:51
(JSON) List of countries and its states
[{
"country" : "Afghanistan",
"states" : "Badakhshan|Badghis|Baghlan|Balkh|Bamian|Farah|Faryab|Ghazni|Ghowr|Helmand|Herat|Jowzjan|Kabol|Kandahar|Kapisa|Konar|Kondoz|Laghman|Lowgar|Nangarhar|Nimruz|Oruzgan|Paktia|Paktika|Parvan|Samangan|Sar-e Pol|Takhar|Vardak|Zabol"
}, {
"country" : "Albania",
"states" : "Berat|Bulqize|Delvine|Devoll (Bilisht)|Diber (Peshkopi)|Durres|Elbasan|Fier|Gjirokaster|Gramsh|Has (Krume)|Kavaje|Kolonje (Erseke)|Korce|Kruje|Kucove|Kukes|Kurbin|Lezhe|Librazhd|Lushnje|Malesi e Madhe (Koplik)|Mallakaster (Ballsh)|Mat (Burrel)|Mirdite (Rreshen)|Peqin|Permet|Pogradec|Puke|Sarande|Shkoder|Skrapar (Corovode)|Tepelene|Tirane (Tirana)|Tirane (Tirana)|Tropoje (Bajram Curri)|Vlore"
}, {
"country" : "Algeria",
"states" : "Adrar|Ain Defla|Ain Temouchent|Alger|Annaba|Batna|Bechar|Bejaia|Biskra|Blida|Bordj Bou Arreridj|Bouira|Boumerdes|Chlef|Constantine|Djelfa|El Bayadh|El Oued|El Tarf|Ghardaia|Guelma|Illizi|Jijel|Khenchela|Laghouat|M'Sila|Mascara|Medea|Mila|Mostaganem|Naama|Oran|Ouargla|Oum e
@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 / gist:f3afa204a7530679eaf4
Last active August 29, 2017 05:23
CoffeeScript Style Guide (using no prototype)
### flipjs.io CoffeeScript Style Guide ###
do ->
############################################################ CLASS ###
class Animal
constructor: (@name) ->
initProps = =>
@flipjs
flipjs / gist:085b05b620e94b6bd3d5
Last active August 29, 2015 14:14
CoffeeScript Style Guide (Bindable Members Up Top)
### flipjs.io CoffeeScript Style Guide ###
do ->
############################################################ CLASS ###
class Animal
constructor: (@name) ->
@legs = 4
@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?)

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>This is the day</h1>
</body>
</html>
@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