Skip to content

Instantly share code, notes, and snippets.

View pappu687's full-sized avatar

Md. Mahbubur Rahman pappu687

View GitHub Profile
@pappu687
pappu687 / import.md
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
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
<?php
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
pappu687 / angular-feed-reader
Last active December 25, 2017 16:49
Quick Feed Reader with AngularJS
<!DOCTYPE html>
<html ng-app="RSSFeedApp">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>AngularJS Feed Reader - jsFiddle demo</title>
<script type='text/javascript' src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<script type='text/javascript' src='//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.1/angular.min.js'></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css">
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-responsive.min.css">
https://images.unsplash.com/photo-1448318440207-ef1893eb8ac0
https://images.unsplash.com/photo-1447678523326-1360892abab8
https://images.unsplash.com/photo-1445754574409-bcd715e18017
https://images.unsplash.com/photo-1444682717031-a2498d603d5b
https://images.unsplash.com/photo-1442405740009-7b57cca9d316
https://images.unsplash.com/photo-1439337153520-7082a56a81f4
https://images.unsplash.com/photo-1433832597046-4f10e10ac764
https://images.unsplash.com/photo-1430651717504-ebb9e3e6795e
https://images.unsplash.com/photo-1428190318100-06790c8b2e5a
https://images.unsplash.com/photo-1422504090664-c57eba84293f
@pappu687
pappu687 / gogs.conf
Created December 8, 2016 05:40
Supervisor Conf for Gogs (gogs Version: 0.9.99)
[program:gogs]
directory = /home/gogs/gogs-repositories
command=/usr/bin/gogs run web
autostart=true
autorestart=true
startsecs=10
stdout_logfile=/var/log/gogs/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
@pappu687
pappu687 / amazon-scrap-schema.json
Last active November 1, 2016 04:25
Amazon Scrap Schema
{
"title" : "//*[@id='productTitle']"
}
@pappu687
pappu687 / adminer.css
Last active May 28, 2016 22:28
FLAT UI Flavored Adminer Theme
/*
FLAT UI Flavored Adminer Theme by M. Mahbubur Rahman (mahbub@mahbubblog.com)
Screenshot : http://d.pr/i/cznH
Based on work by : Lukáš Brandejs
https://raw.github.com/vrana/adminer/master/designs/ng9/adminer.css
*/
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600);
* {
@pappu687
pappu687 / overview-for-angular-apps-with-roles-and-permissions.md
Created May 1, 2016 08:56 — forked from bvaughn/overview-for-angular-apps-with-roles-and-permissions.md
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
pappu687 / my-tmuxifier-layout.sh
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
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>