Skip to content

Instantly share code, notes, and snippets.

View obelich's full-sized avatar
:octocat:
Aprendiendo Dart + Flutter

Oscar Miguel Amezcua Estrella obelich

:octocat:
Aprendiendo Dart + Flutter
View GitHub Profile
@umidjons
umidjons / enter-as-tab-directive.md
Created January 5, 2015 14:35
AngularJS directive: Enter as Tab

AngularJS directive: Enter as Tab

angular.module('App',[])
	.directive('enter',function(){
		return function(scope,element,attrs){
			element.bind("keydown keypress",function(event){
				if(event.which===13){
 event.preventDefault();
@simkimsia
simkimsia / ubuntu14.04-cake2.4.sh
Last active May 27, 2023 06:55
preparing a fresh 14.04 ubuntu for cakephp 2.4
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
#
# Ubuntu 14.04 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 14.04 server:
#
# bash -c "$(curl -fsSL https://gist.githubusercontent.com/simkimsia/691e97f40b2544644f9a/raw/ubuntu14.04-cake2.4.sh)" <mysqlPassword>
before_filter :find_position, only: [:show, :destroy, :edit]
def destroy
if @position.destroy
flash[:success] = t('labels.success')
else
flash[:error] = t('labels.error')
end
redirect_to positions_path
end
@jourdein
jourdein / gist:5412399
Last active December 21, 2016 01:35
Postgresql 9.1 On Ubuntu 12.10 Linux (Quantal Quetzal)
# STEP 1: VERIFY THAT YOU DO NOT ALREADY HAVE POSTGRESQL INSTALLED ON YOUR SYSTEM
ps ax | grep postgres
# STEP 2: INSTALL POSTGRESQL ON YOUR SYSTEM
sudo apt-get update
sudo apt-get install postgresql-9.1
# List All Postgres related packages
dpkg -l | grep postgres
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one