Skip to content

Instantly share code, notes, and snippets.

View mahmudkuet11's full-sized avatar

Md. Mahmud Ur Rahman mahmudkuet11

View GitHub Profile
@mahmudkuet11
mahmudkuet11 / code_server.md
Last active November 2, 2020 18:12
Code Server
  • Login to server
  • Run wget https://github.com/cdr/code-server/releases/download/2.1698/code-server2.1698-vsc1.41.1-linux-x86_64.tar.gz . Also check the url https://github.com/cdr/code-server/releases for latest version.
  • Run tar -xzvf code-server2.1698-vsc1.41.1-linux-x86_64.tar.gz
  • Run cd code-server2.1698-vsc1.41.1-linux-x86_64
  • Run sudo mv ./code-server /usr/local/bin
  • Run code-server and you will get a one time password. Visit http://server-ip-address:8080 and use the password to login.
@mahmudkuet11
mahmudkuet11 / .php_cs.dist
Last active February 3, 2020 03:48 — forked from codfish/.php_cs.dist
PHP-CS-Fixer configuration file. PSR-2 plus some opinionated options to make code cleaner.
<?php
/**
* Rules we follow are from PSR-2 as well as the rectified PSR-2 guide.
*
* - https://github.com/FriendsOfPHP/PHP-CS-Fixer
* - https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
* - https://github.com/php-fig-rectified/fig-rectified-standards/blob/master/PSR-2-R-coding-style-guide-additions.md
*
* If something isn't addressed in either of those, some other common community rules are
@mahmudkuet11
mahmudkuet11 / english_to_bangla.js
Created August 28, 2019 08:34 — forked from sharif2008/english_to_bangla.js
Converting English number to Bangla in Javascript
var finalEnlishToBanglaNumber={'0':'০','1':'১','2':'২','3':'৩','4':'৪','5':'৫','6':'৬','7':'৭','8':'৮','9':'৯'};
String.prototype.getDigitBanglaFromEnglish = function() {
var retStr = this;
for (var x in finalEnlishToBanglaNumber) {
retStr = retStr.replace(new RegExp(x, 'g'), finalEnlishToBanglaNumber[x]);
}
return retStr;
};
@mahmudkuet11
mahmudkuet11 / example.local
Last active June 26, 2018 17:37
Nginx Server Config
server {
listen 80;
root /path-to-your-project/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.local admin.example.local partner.example.local;
location / {
@mahmudkuet11
mahmudkuet11 / copyToClipboard.js
Created March 28, 2018 02:41
Native way to copy text to clipboard in javascript
function copyToClipboard(value) {
var tempInput = document.createElement("textarea");
tempInput.style = "position: absolute; left: -1000px; top: -1000px";
tempInput.value = value;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand("copy");
document.body.removeChild(tempInput);
}
@mahmudkuet11
mahmudkuet11 / GitCommitEmoji.md
Created March 7, 2018 08:06 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@mahmudkuet11
mahmudkuet11 / pt-query-digest
Created February 26, 2018 08:39
Percona Query Digest
#!/usr/bin/env perl
# This program is part of Percona Toolkit: http://www.percona.com/software/
# See "COPYRIGHT, LICENSE, AND WARRANTY" at the end of this file for legal
# notices and disclaimers.
use strict;
use warnings FATAL => 'all';
# This tool is "fat-packed": most of its dependent modules are embedded
@mahmudkuet11
mahmudkuet11 / gist:b2dbf467b3fa4dbcd0d3b446bf2b64b0
Created February 10, 2018 10:14 — forked from JesseObrien/gist:7418983
Bind parameters into the SQL query for Laravel ORM
<?php
class MyModel extends Eloquent {
public function getSql()
{
$builder = $this->getBuilder();
$sql = $builder->toSql();
foreach($builder->getBindings() as $binding)
{
@mahmudkuet11
mahmudkuet11 / gist:5b0a8d7c7f666dcc0be86f405564a470
Created September 29, 2017 05:43 — forked from jcsrb/gist:1081548
get avatar from google profiles, facebook, gravatar, twitter, tumblr
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
@mahmudkuet11
mahmudkuet11 / CommentController.php
Created June 15, 2017 05:43 — forked from FilipQL/CommentController.php
Infinite Scroll Pagination Using Laravel & jScroll
<?php
// For more details see: http://laraget.com/blog/implementing-infinite-scroll-pagination-using-laravel-and-jscroll
namespace App\Http\Controllers\InfiniteScrolling;
use App\Comment;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;