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 / 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 / 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 / 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 / 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"
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 / laravel-related-posts.php
Created December 3, 2015 11:31
Related posts in Laravel
@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 / Sublime Packages.md
Last active August 12, 2017 13:27
Sublime config
  • DocBlockr
  • AdvancedNewFile
  • SnippetMaker
  • PHP Companion
  • SublimeLinter
  • SublimeLinter-phpcs
  • PHP CS Fixer
@sohelamin
sohelamin / laravel.php
Created November 8, 2015 11:19
Laravel & Wordpress Login Together
<?php
Route::get('/wordpress', function(){
require('..\wordpress\wp-load.php');
return loginUser(Auth::user()->username);
});
@sohelamin
sohelamin / guide.md
Last active January 12, 2016 18:04
Useful tool installation guide

Open JDK 8 installation

sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
java -version