Skip to content

Instantly share code, notes, and snippets.

View pappu687's full-sized avatar

Md. Mahbubur Rahman pappu687

View GitHub Profile
pappu687 / wp-config.php
Created November 16, 2020 18:31
WP-CONFIG modifications for Wordpress sites behind EC2 Application Load Balancer. Fixes the redirect loop when trying to access /wp-admin
define('FORCE_SSL_ADMIN', true);
if ( (isset($_SERVER['HTTP_X_FORWARDED_PORT'] ) && ( '443' == $_SERVER['HTTP_X_FORWARDED_PORT'] ))
|| (isset($_SERVER['HTTP_CF_VISITOR']) && $_SERVER['HTTP_CF_VISITOR'] == '{"scheme":"https"}')) {
$_SERVER['HTTPS'] = 'on';
* Rest of the wp-config.php below.
pappu687 / gogs.conf
Created December 8, 2016 05:40
Supervisor Conf for Gogs (gogs Version: 0.9.99)
directory = /home/gogs/gogs-repositories
command=/usr/bin/gogs run web
pappu687 / amazon-scrap-schema.json
Last active November 1, 2016 04:25
Amazon Scrap Schema
"title" : "//*[@id='productTitle']"
pappu687 /
Last active February 27, 2023 21:14
How to import large flat text file into mysql table

Import Large flat text file into mysql

Say you have a 1GB text file (words.txt) and has a word each line. Like this

1. John
2. Doe
3. Jane
4. Smith
pappu687 /
Created May 1, 2016 08:56 — forked from bvaughn/
RE: Reddit Angular JS question "Advice on separating the logical parts of an application"

This gist is in response to a question asked on the Reddit Angular JS forum about how to structure an Angular app with roles and permissions.

There are many ways to approach this, but I'll share one that I've used before and maybe it will give you an idea. I'd combine all of the above into a single app and control who gets to see what using permissions. There are a few components to this approach...

A local session service

First off I'd advise creating some sort of local session management service. This should be able to track whether you have an authenticated user and- if so- what types of permissions that user has. (Lots of ways to manage permissions. I'll assume your user object has either a 'role' enum or something simple like an array of string permissions.) You could roll your own session service or you could check out something like satellizer.

Let's assume yo

pappu687 /
Created January 10, 2016 12:33
My Tmuxifier for a Laravel project
window_root "~/Code/Project"
# Create new window. If no argument is given, window name will be based on
# layout file name.
new_window "canon"
# Split window into panes.
split_h 50
split_v 50 1
split_v 50 2
pappu687 / country-dropdown-de.txt
Created January 7, 2016 04:59
Country Dropdown in German
<select name="countries">
<option value="DE">Deutschland</option>
<option value="AT">Österreich</option>
<option value="CH">Schweiz</option>
<option value="LU">Luxemburg</option>
<option value="AF">Afghanistan</option>
<option value="EG">Ägypten</option>
<option value="AX">Åland</option>
<option value="AL">Albanien</option>
<option value="DZ">Algerien</option>
pappu687 / global-js
Last active August 29, 2015 14:01
JavaScript Global
<script src="js-1.js"></script>
<script src="js-2.js"></script>
pappu687 / 0_reuse_code.js
Created April 14, 2014 15:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console