Skip to content

Instantly share code, notes, and snippets.

View natchiketa's full-sized avatar

Sara Lara natchiketa

View GitHub Profile
@natchiketa
natchiketa / (+ _)
Last active August 29, 2015 14:00 — forked from paulcarey/(+ $ _)
Bookmarklet to inject underscore.js on a page
javascript:(function%20()%20{%20var%20_%20=%20document.createElement('script');%20_.src%20=%20'http://documentcloud.github.com/underscore/underscore-min.js';%20_.type%20=%20'text/javascript';%20document.getElementsByTagName('head')[0].appendChild(_);%20})()
@natchiketa
natchiketa / plcomvim.sh
Created May 10, 2014 03:31
Bash installation script for Pivotal Labs Vim config
git clone git://github.com/pivotalcommon/vim-config.git ~/.vim
cd ~/.vim
git submodule update --init
ln -s ~/.vim/vimrc ~/.vimrc
vim +BundleInstall +qall
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@natchiketa
natchiketa / cssformat.py
Created July 16, 2014 15:35
Script for formatting CSS
#!/usr/bin/env python
#
# Convert CSS/SASS/SCSS/LESS code to Expanded, Compact or Compressed format.
# written by Mutian Wang <mutian.wang@gmail.com>
#
# usage:
# format_code(code, action)
#
@natchiketa
natchiketa / jazz_hands-ruby_2_1_2.rb
Created July 26, 2014 19:32
Using jazz_hands gem with Ruby 2.1.2
# In your Gemfile
# ...your gems
group :development, :test do
# Whatever gems you already have in this group
gem 'jazz_hands', github: 'nixme/jazz_hands', branch: 'bring-your-own-debugger'
gem 'pry-byebug' # This may or may not work with 2.1.2 either, so remove if you still get errorrs
gem "awesome_print"
@natchiketa
natchiketa / gist:9378e0f812823e8d6fc5
Created August 9, 2014 18:56
Bookmarklet to remove elements
javascript:(function(){
[].prototype
.forEach
.call(document.querySelectorAll('[id*="taboola"]'), function(el) {
el.parentElement.removeChild(el);
}
})();
@natchiketa
natchiketa / polygon
Created August 26, 2014 15:05
Some polygon in GeoJSON format
{
"type": "MultiPolygon",
"coordinates": [
[
[
[
-9391674.191839194,
3998993.2908226354
],
[
@natchiketa
natchiketa / minute_steps.coffee
Last active August 29, 2015 14:05
Create time range in minute increments w/Lo-Dash and time.js
# Requires Lo-Dash and zever/time.js
timeFromMinutes = (mins) ->
Time ("#{((if mins < 780 then ~~(mins / 60) else (~~(mins / 60) - 12)))}:#{mins % 60} ")
.replace(/:0 /, ":00 #{if mins >= 720 then 'PM' else 'AM'}")
minuteIncrements = (range) ->
_.map range, (mins) ->
timeFromMinutes mins
@natchiketa
natchiketa / SampleRails4Gemfile.rb
Created September 11, 2014 18:58
Rails 4 Gemfile example
source 'https://rubygems.org'
ruby '2.1.2'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use postgresql as the database for Active Record
gem 'pg'
# Use HAML for templates
@natchiketa
natchiketa / alfred2_workflows.md
Last active August 29, 2015 14:06
Creating Alfred 2 Workflows

Search Results

The caniuse workflow

Say you look up 'transform':

To build this type of result:

caniuse result item