Skip to content

Instantly share code, notes, and snippets.

View sureshamk's full-sized avatar

suresh sureshamk

  • Bangloure , I ndia
View GitHub Profile
@sureshamk
sureshamk / test.js
Last active August 29, 2015 14:17 — forked from yangsu/test.js
var assert = require('assert');
var mongoose = require('mongoose');
var async = require('async');
var Schema = mongoose.Schema;
var ObjectId = mongoose.Types.ObjectId;
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
location /selfoss/ {
try_files $uri $uri/ @selfoss;
}
location @selfoss {
rewrite /selfoss/ /selfoss/index.php;
}
location ^/selfoss/index.php(/.*)?$ {
fastcgi_split_path_info ^(/selfoss/index.php)(/.*)$;
if(isset($_POST['submit'])){
$firstName = isset($_POST['firstName']) ? $_POST['firstName'] : '';
$middleName = isset($_POST['middleName']) ? $_POST['middleName'] : '';
$lastName = isset($_POST['lastName']) ? $_POST['lastName'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$mobile = isset($_POST['mobile']) ? $_POST['mobile'] : '';
$locations = isset($_POST['locations_list']) ? $_POST['locations_list'] : '';
$position = isset($_POST['position']) ? $_POST['position'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
@sureshamk
sureshamk / Test.php
Created November 10, 2016 06:53
Composer Install
Test
if
@sureshamk
sureshamk / nginx.conf
Created November 11, 2016 09:42
Directory listing in Nginx - Sureshvel.com
server {
listen 80;
server_name domain.com www.exampple.com;
autoindex on;
}
@sureshamk
sureshamk / rename.sh
Last active December 2, 2016 18:29
rename files with suffex in middle
# test
find . -name "*.class.php" -type f -exec rename -n 's/\.class.php$/\.php/' *.php '{}' \;
# execute
find . -name "*.class.php" -type f -exec rename 's/\.class.php$/\.php/' *.php '{}' \;
#!/usr/bin/env bash
@sureshamk
sureshamk / findAndReplace.regex
Created December 2, 2016 06:31
find and replace the function in phpstrom
public function __toString()[^$:}]+}
@sureshamk
sureshamk / tools-and-guideline-for-MACos-Laravel-php-developer
Last active March 15, 2017 06:51
MAC OS setup for PHP/Laravel Developer for first time
Tools :
GIT
PHP
Nginx
mysql
Sublime , PhpStorm, ATOM, VIM
@sureshamk
sureshamk / .zshrc
Created March 21, 2017 07:25
laravel-php-aliases
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package
@sureshamk
sureshamk / DebugServiceProvider.php
Created March 21, 2017 07:52 — forked from developerdino/DebugServiceProvider.php
Laravel: Log all queries with bound parameters observer.
<?php
namespace App\Providers;
use Illuminate\Database\Events\QueryExecuted;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
class DebugServiceProvider extends ServiceProvider