For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
For the scenario, imagine posts has a foreign key user_id referencing users.id
public function up()
{
Schema::create('posts', function(Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->text('body');
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
# Basically the nginx configuration I use at konklone.com. | |
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com | |
# | |
# To provide feedback, please tweet at @konklone or email [email protected]. | |
# Comments on gists don't notify the author. | |
# | |
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites. | |
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration. | |
server { |
/** | |
* Make sure Graphicsmagick is installed on your system | |
* osx: brew install graphicsmagick | |
* ubuntu: apt-get install graphicsmagick | |
* | |
* Install these gulp plugins | |
* glup, gulp-image-resize, gulp-imagemin and imagemin-pngquant | |
* | |
* Group images according to their output dimensions. | |
* (ex: place all portfolio images into "images/portfolio" |
sudo apt-get install build-essential | |
sudo apt-get update | |
# BLAS → LAPACK → ATLAS → numpy → scipy → Theano | |
# remove numpy and scipy | |
sudo apt-get remove python-numpy | |
sudo apt-get remove python-scipy | |
# Instalation commands | |
sudo apt-get install gfortran | |
sudo apt-get install libopenblas-dev | |
sudo apt-get install liblapack-dev |
# Scala Installation | |
wget www.scala-lang.org/files/archive/scala-2.11.8.deb | |
sudo dpkg -i scala-2.11.8.deb | |
# sbt Installation | |
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823 | |
sudo apt-get update | |
sudo apt-get install sbt |
<?php | |
if(!function_exists('config_path')) | |
{ | |
/** | |
* Return the path to config files | |
* @param null $path | |
* @return string | |
*/ | |
function config_path($path=null) |
// Create MessagesTranslationServiceProvider | |
// example in : app/Providers/MessagesTranslationServiceProvider.php | |
<?php | |
namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use App\Services\MessagesTranslator; |
/* | |
* The function of this class is to find all prime numbers in range given by the user. | |
* | |
* This homework assignment requires several references: | |
* http://www.avajava.com/tutorials/lessons/how-do-i-use-threads-join-method.html | |
* http://stackoverflow.com/questions/1428786/best-way-to-find-a-prime-number | |
* http://web.mit.edu/16.070/www/lecture/big_o.pdf | |
* http://en.wikipedia.org/wiki/Sieve_of_Atkin | |
* http://stackoverflow.com/questions/3790142/java-equivalent-of-pythons-rangeint-int | |
* http://stackoverflow.com/questions/17279519/removing-items-from-list-in-java |