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
| function mysqli_result($res, $row=0, $col=0){ | |
| $numrows = mysqli_num_rows($res); | |
| if ($numrows && $row <= ($numrows-1) && $row >=0){ | |
| mysqli_data_seek($res,$row); | |
| $resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res); | |
| if (isset($resrow[$col])) { | |
| return $resrow[$col]; | |
| } | |
| } | |
| return false; |
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
| <?php | |
| class UsersController extends BaseController | |
| { | |
| public function __construct() | |
| { | |
| parent::__construct(); | |
| $this->load->model('user_model', 'user'); | |
| } |
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
| class User extends Model | |
| { | |
| public static function boot() | |
| { | |
| parent::boot(); | |
| static::deleted(function ($user) { | |
| foreach($user->articles as $article) { | |
| $article->delete(); | |
| } |
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
| <?php namespace Acme\DiffFormatters; | |
| // app/Acme/DiffFormatters/IdDiffFormatter.php | |
| use Laravelrus\LocalizedCarbon\DiffFormatters\DiffFormatterInterface; | |
| use Lang; | |
| class IdDiffFormatter implements DiffFormatterInterface { | |
| /** |
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
| /* | |
| * 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 |
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 MessagesTranslationServiceProvider | |
| // example in : app/Providers/MessagesTranslationServiceProvider.php | |
| <?php | |
| namespace App\Providers; | |
| use Illuminate\Support\ServiceProvider; | |
| use App\Services\MessagesTranslator; |
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
| <?php | |
| if(!function_exists('config_path')) | |
| { | |
| /** | |
| * Return the path to config files | |
| * @param null $path | |
| * @return string | |
| */ | |
| function config_path($path=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
| # 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 |
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
| 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 |
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
| /** | |
| * 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" |