Skip to content

Instantly share code, notes, and snippets.

View nmfzone's full-sized avatar
🍿
I'm hungry

Nabil Muhammad Firdaus nmfzone

🍿
I'm hungry
View GitHub Profile
@nmfzone
nmfzone / gist:71e5723318fce630b72d
Created October 31, 2015 19:36 — forked from isimmons/gist:8202227
Truncate tables with foreign key constraints in a Laravel seed file.

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');
@nmfzone
nmfzone / introrx.md
Created December 2, 2015 23:10 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@nmfzone
nmfzone / ssl.rules
Created December 10, 2015 09:29 — forked from konklone/ssl.rules
nginx TLS / SSL configuration options for konklone.com
# 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 {
@nmfzone
nmfzone / tmux-cheatsheet.markdown
Created January 28, 2016 14:47 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@nmfzone
nmfzone / gulp-resize-and-minify-images.js
Created February 3, 2016 13:10 — forked from ryantbrown/gulp-resize-and-minify-images.js
Gulp - Resize and Optimize / Minify Images
/**
* 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"
@nmfzone
nmfzone / install.sh
Created March 9, 2016 10:42 — forked from Reddine/install.sh
Install Theano on Ubuntu 14.04
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
@nmfzone
nmfzone / gist:2dc02fb73f30c47faf39005bd21d6331
Last active June 7, 2020 02:53 — forked from bigsnarfdude/gist:b2eb1cabfdaf7e62a8fc
Install Scala 2.11.8 and sbt 13.11 in Ubuntu 14.04
# 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
@nmfzone
nmfzone / compat_l5.php
Created May 31, 2016 15:45 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@nmfzone
nmfzone / MessagesTranslationServiceProvider.php
Last active March 18, 2023 17:25
Laravel language files on custom directory
// Create MessagesTranslationServiceProvider
// example in : app/Providers/MessagesTranslationServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Services\MessagesTranslator;
@nmfzone
nmfzone / SieveOfAtkin-Java.java
Created September 1, 2016 07:25 — forked from hephaestus9/SieveOfAtkin-Java.java
Sieve Of Atkin - Java
/*
* 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