Skip to content

Instantly share code, notes, and snippets.

View gaboesquivel's full-sized avatar
👾
buidl

Gabo Esquivel gaboesquivel

👾
buidl
View GitHub Profile
@gaboesquivel
gaboesquivel / page.rb
Created June 18, 2013 16:08
bettys sort
def self.bettys_sort
array = [[1, 2], [1, 1], [2, 2], [2, 1], [3, 1]]
puts "Original --> " + array.to_s
array_sorted = array.sort{|x,y| x <=> y}
puts "Sorted --> " + array_sorted.to_s
end
def self.bettys_sort_y
array = [[1, 2], [1, 1], [2, 2], [2, 1], [3, 1]]
array = reverse(array)
@gaboesquivel
gaboesquivel / page.rb
Created June 18, 2013 16:26
shitty sort
class Page < ActiveRecord::Base
attr_accessible :body, :category_id, :title
belongs_to :category
def self.bettys_sort_asc
array = [[1, 2], [1, 1], [2, 2], [2, 1], [3, 1]]
puts "Original --> " + array.to_s
array_sorted = array.sort{|x,y| x <=> y}
puts "Sorted --> " + array_sorted.to_s
end
es:
sessionmodal:
header:
login:
title: "Bienvenido de nuevo a New Futuro."
sign_up:
title: "Comienza el camino hacia tu futuro."
footer:
login:
msg: "¿No eres miembro?"
@gaboesquivel
gaboesquivel / gist:5961103
Last active December 19, 2015 13:19 — forked from jasoncodes/gist:1223731
Installing Ruby 1.9.3 on Mac OS X with rbenv
# The latest version of this script is now available at
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh
VERSION=1.9.3-p286
brew update
brew install rbenv ruby-build rbenv-vars readline ctags
if [ -n "${ZSH_VERSION:-}" ]; then
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc
else
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
@gaboesquivel
gaboesquivel / gist:6000043
Created July 15, 2013 13:44
html2haml in zsh
for f (**/*.html.erb) { html2haml $f $f:r.haml; rm $f }
# Restart the Apache server
/usr/local/zend/bin/zendctl.sh restart

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@gaboesquivel
gaboesquivel / gist:6613596
Last active December 23, 2015 09:19
angulardemo1
<!doctype html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
</head>
<body>
<div>
<label>Name:</label>
<input type="text" ng-model="yourName" placeholder="Enter a name here">
<hr>
/**
* Each section of the site has its own module. It probably also has submodules
* For example, a `note` section could have the submodules `note.create`,
* `note.delete`, `note.edit`, etc.
*
* The dependencies block here is also where component dependencies should be
* specified, as shown below.
*/
angular.module( 'ngBoilerplate.home', [
'ui.state',
<body ng-app="app" ng-controller="MainCtrl">
What's your name?:
<input type="text" ng-model="user.name" />
<button ng-click="greet()">Click here!</button>
<h3>{{ message }}</h3>
</body>