⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urlparse | |
import re | |
from django.db import models | |
from django import forms | |
def validate_youtube_url(value): | |
'''El patron lo saque de http://stackoverflow.com/questions/2964678/jquery-youtube-url-validation-with-regex''' | |
pattern = r'^http:\/\/(?:www\.)?youtube.com\/watch\?(?=.*v=\w+)(?:\S+)?$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331' | |
version '7.3.515' | |
def features; %w(tiny small normal big huge) end | |
def interp; %w(lua mzscheme perl python python3 tcl ruby) end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
block goods { | |
tag: 'ul' | |
content: { | |
var content = []; | |
this.ctx.goods.forEach(function(item){ | |
var mods = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To use this recipe you have to: | |
# $ brew install python --framework | |
# $ mkdir ~/Frameworks | |
# $ ln -s "/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework" ~/Frameworks | |
# $ brew install ./vim.rb | |
require 'formula' | |
require 'open-uri' | |
class Vim < Formula |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "active_admin/mixins" | |
@import "active_admin/components/links" | |
body | |
@include global-reset | |
@import "active_admin/typography" | |
@import "active_admin/header" | |
@import "active_admin/forms" | |
@import "active_admin/components/comments" | |
@import "active_admin/components/flash_messages" |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Update and upgrade packages | |
sudo apt-get update && sudo apt-get upgrade | |
# Install postgres 9.3 | |
sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 postgresql-contrib-9.3 | |
# Having Postgres 9.2 already, this will create database instance configured to run on port 5433 |
OlderNewer