Skip to content

Instantly share code, notes, and snippets.

View sohelamin's full-sized avatar
🎯
Focusing

Sohel Amin sohelamin

🎯
Focusing
View GitHub Profile
@sohelamin
sohelamin / drop-table
Created November 18, 2015 18:53
Laravel drop tables via artisan command
php artisan tinker
$tables = DB::select('SHOW TABLES');
$tables_in_database = "Tables_in_".Config::get('database.connections.mysql.database');
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
foreach ($tables as $table) {
Schema::drop($table->$tables_in_database);
}
@sohelamin
sohelamin / laravel-related-posts.php
Created December 3, 2015 11:31
Related posts in Laravel
var gulp = require('gulp');
var copy = require('gulp-copy');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var connect = require('gulp-connect');
var browserify = require('browserify');
var partialify = require('partialify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
@sohelamin
sohelamin / git.md
Created December 5, 2015 13:28
Git Commands
git checkout gh-pages
git checkout master -- myplugin.js
git commit -m "Update myplugin.js from master"
@sohelamin
sohelamin / endpoints.php
Created December 7, 2015 18:39 — forked from joncave/endpoints.php
WP_Rewrite endpoints demo
<?php
/*
Plugin Name: WP_Rewrite endpoints demo
Description: A plugin giving example usage of the WP_Rewrite endpoint API
Plugin URI: http://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/
Author: Jon Cave
Author URI: http://joncave.co.uk/
*/
function makeplugins_endpoints_add_endpoint() {
@sohelamin
sohelamin / serialized-query.sql
Created December 10, 2015 11:52
serialized sql query
SELECT *
FROM `site_posts`
WHERE `category_slug` REGEXP 's:[0-9]+:"uncategoriz".*'
LIMIT 0 , 30
@sohelamin
sohelamin / run-multiple-redis-instances.md
Last active December 14, 2015 08:51 — forked from jarvys/run-multiple-redis-instances.md
run multiple redis instances on the same server for centos
  • create a new redis .conf file
$ cp /etc/redis/redis.conf /etc/redis/redis-server1.conf
  • edit /etc/redis/redis-server1.conf, illustrated as below
...
@sohelamin
sohelamin / command.md
Created December 20, 2015 05:27
Laravel Storage Dir Permission
sudo chmod -R gu+w storage

sudo chmod -R guo+w storage

php artisan cache:clear
@sohelamin
sohelamin / commands.md
Created December 20, 2015 05:46
Linux Commands
sudo nohup supervisor socket.js &
@sohelamin
sohelamin / url.md
Created December 27, 2015 16:05
Restful URL