Skip to content

Instantly share code, notes, and snippets.

View meSingh's full-sized avatar
😜
Making products..

Mandeep Singh meSingh

😜
Making products..
View GitHub Profile
@meSingh
meSingh / .htaccess
Created June 20, 2013 11:42
Laravel's (L3) .htaccess to remove "public" from URL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@meSingh
meSingh / truncate.php
Created July 1, 2013 13:32
Cut a string on a specific length or make the long string shorter in php with spaces support.
<?php
/**
*
* Make the string of a defined length
*
* @param string $string
* @param integer $max_length
* @param boolean $trunc_at_space
* @param string $replacement
@meSingh
meSingh / make_slug.php
Created July 1, 2013 13:35
Create WordPress like slugs from any string in php.
<?php
/**
*
* Genrate Slugs from Title or any given string
*
* @param string $str
* @return Slug
*
**/
@meSingh
meSingh / nice_time_ago.php
Created July 1, 2013 13:37
Create nicely formatted timestamps in php
<?php
/**
*
* Creates nicely formated timestamps
*
* @param timestamp $date
* @return string
*/
public static function get_x_time_ago($date)
@meSingh
meSingh / .gitignore
Last active December 20, 2015 04:59
Global .gitignore file
### Laravel ###
app/config/dev/
bootstrap/compiled.php
.env.*.php
.env.php
### Composer ###
composer.phar
vendor/

Awesome PHP

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

@meSingh
meSingh / List.md
Last active August 29, 2015 14:08 — forked from msurguy/List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

@meSingh
meSingh / routes.php
Created May 26, 2015 13:43
Lumen Resource Routes
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
@meSingh
meSingh / gist:817f4d85f2094bd7d89b
Last active August 29, 2015 14:25 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
server {
listen 80;
listen [::]:80;
server_name site.com;
root /home/forge/site.com;
# FORGE SSL (DO NOT REMOVE!)
# ssl on;
# ssl_certificate;
# ssl_certificate_key;