Skip to content

Instantly share code, notes, and snippets.

View miladr's full-sized avatar

Milad Reyhani miladr

  • Shell
  • Amsterdam
View GitHub Profile
@Garbee
Garbee / gist:6875041
Created October 7, 2013 21:12
Tinker quick tip.

Laravel has an awesome command called "tinker". This is just a really quick way for you to interact with your application in the command line. It has a great use for debugging new models. Let's check out a quick example:

php artisan tinker

You are now dropped into a PHP terminal. Here you can input whatever you want to execute, like the following.

$user = new User;
$user->first_name = Adam;
@driesvints
driesvints / laravel-weekly-23-quick-tip.php
Last active October 23, 2018 07:52
Laravel Weekly #23 - Quick Tip
<?php
# Create a list with numbers ranging from 10 to 20.
Form::selectRange('number', 10, 20);
# Create a list with years ranging from 1900 to 2000.
Form::selectYear('year', 1900, 2000);
# Creates a list with month names.
Form::selectMonth('month');
@arashmilani
arashmilani / gist:4732488
Created February 7, 2013 17:13
Trying to find much better way to assert Types in javascript rather than comparing types in string using typeof
function assertType(obj, type) {
return obj.constructor.name === type.name
}
console.info(assertType("test", String)); //true
console.info(assertType(1, String)); //false
console.info(assertType(1, Number)); //true
function Book(){};
function Desk(){};