Skip to content

Instantly share code, notes, and snippets.

View milon's full-sized avatar
📧
Want a quick response? Tweet @to_milon.

Nuruzzaman Milon milon

📧
Want a quick response? Tweet @to_milon.
View GitHub Profile
@milon
milon / style
Created November 19, 2014 06:52
Bootstrap media query for responsive design
/**
* Bootstrap CSS
* CSS3 Media query for responsive design
*/
/* large grid only */
@media (min-width: 1200px) {
}
@milon
milon / numberToWord.php
Created February 26, 2015 08:13
Convert number to Word
function numberToWord($number) {
$hyphen = '-';
$conjunction = ' and ';
$separator = ', ';
$negative = 'negative ';
$decimal = ' point ';
$dictionary = array(
0 => 'zero',
1 => 'one',
2 => 'two',
@milon
milon / Sublime Text Packages.md
Created June 16, 2015 11:57
Sublime Text Package that I used Day to Day Basis
@milon
milon / node-and-npm-in-30-seconds.sh
Last active August 29, 2015 14:25 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@milon
milon / laravel.js
Last active August 29, 2015 14:25 — forked from soufianeEL/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@milon
milon / Laravel-Image-Response.md
Last active October 19, 2015 08:36
Laravel Image Response.md

Laravel's document root is public folder. But you often needs to put your assets like images on other folders than public. Here is an example using intervestion/image package on laravel.

Route::get('images/{name}', function($name){
	if(! file_exists(storage_path("/app/$name"))){
		return App::abort(404);
	}

	// Get the image
@milon
milon / route-01.php
Created February 16, 2016 01:34
Laravel Route Example
<?php
Route::get('/', function() {
return 'Hello World';
});
Route::get('/login', 'AuthController@loginForm');
Route::post('/login', 'AuthController@postLogin');
Route::delete('/logout', 'AuthController@logout');
@milon
milon / route-02.php
Created February 16, 2016 02:05
Laravel Route Example
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
protected $webNamespace = 'App\Http\Controllers\Web';
@milon
milon / server-laravel.md
Last active May 23, 2017 04:52
Set Up Server for Running Laravel PHP Framework 4.2.16

Set Up Server for Running Laravel PHP Framework 4.2.16


Operating System : Ubuntu 14.04.1

Web Server : Apache 2.4.7

Application Server : PHP 5.5.9

@milon
milon / .gvimrc
Last active August 8, 2017 10:10
My .vimrc file
set guifont=Fira_Code:h15 " font for mac vim
set linespace=14 " line spacing for macvim
set macligatures " Fira code symbols enables
set guioptions-=e " Disable GUI tabs
" remove any scrollbar
set guioptions-=L
set guioptions-=l
set guioptions-=R
set guioptions-=r