This file contains hidden or 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
############################################# | |
# Push de la rama actual | |
git push origin $rama_actual | |
############################################# | |
# Volver a un commit anterior, descartando los cambios | |
git reset --HARD $SHA1 | |
############################################# | |
# Ver y descargar Ramas remotas |
This file contains hidden or 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
console.log($("#you").data("you")); // Hello mean | |
$("#you").data("you", "yes change you atribute"); // yes change you atribute | |
console.log($("#you").data("you")); // yes change you atribute | |
With HTML atributes | |
There has already been an answer chosen as a correct one, however its seems like none of the answers clearly and concisely explain what is happening. | |
So let me give this a shot: |
This file contains hidden or 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
Route::get('/year',function() | |
{ | |
$year= '2013'; | |
return Post::whereRaw('YEAR(`posted_date`) = ?', array($year))->get(); | |
}); | |
Auto: | |
http://albertokempis.com/content/filter-records-according-year-using-laravel-eloquent-orm |
This file contains hidden or 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
$parts = explode('-', '2068-06-15'); | |
echo $parts[0]; |
This file contains hidden or 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> |
This file contains hidden or 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
CREATE TABLE `paises` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`nombre` varchar(50) DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; | |
CREATE TABLE `ciudades` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`pais_id` int(11) DEFAULT NULL, | |
`nombre` varchar(50) DEFAULT NULL, |
This file contains hidden or 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
@foreach ($posts->slice(0, 5) as $post) | |
<h1>{{ $post['title'] }}</h1> | |
@endforeach |
This file contains hidden or 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
Controller Create | |
$ciudades_opciones = \Ciudad::orderBy('nombre', 'asc')->lists('nombre','id'); | |
View of create | |
{{ Form::select('ciudad_id', array('default' => 'Seleccione') + $ciudades_opciones, null, array('class' => 'form-control select2me')) }} | |
Note: the null options is the default value |
This file contains hidden or 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
Example: | |
$user= User::find(1); | |
var_dump($user->projects); | |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |