Skip to content

Instantly share code, notes, and snippets.

View habibun's full-sized avatar

Habibun Noby habibun

  • Eon Infosys Technology
  • Dhaka, Bangladesh
View GitHub Profile
@habibun
habibun / .htaccess
Created January 8, 2016 17:55
Symfony2 shared hosting htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /web/$1 [QSA,L]
</IfModule>
@habibun
habibun / robots.txt
Created January 10, 2016 14:12
Disallow user to download file from hosting
User-agent: *
Disallow: /
@habibun
habibun / X:\xampp\apache\conf\extra\httpd-vhosts.conf
Last active February 9, 2016 06:53
windows virtualhost symfony2
<VirtualHost *:80>
ServerName bbq.local
ServerAlias www.bbq.local
DocumentRoot "C:\xampp\htdocs\restaurant-automation\web"
<Directory "C:\xampp\htdocs\restaurant-automation\web">
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Allow from All
</Directory>
@habibun
habibun / .bash_aliases
Last active August 4, 2016 17:06
git - show current branch in terminal
# manually added for showing branch name in git
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
@habibun
habibun / exactChange.html
Created November 5, 2016 18:18
Exact Change
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Exact Change</title>
<script>
// Create an object which hold the denominations and their values
var denominations = [
{name: 'ONE HUNDRED', val: 100.00},
{name: 'TWENTY', val: 20.00},
@habibun
habibun / active.md
Created December 8, 2016 15:13 — forked from paulmillr/active.md
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Fri, 19 Jun 2015 15:17:38 GMT till Sun, 19 Jun 2016 15:17:38 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 635)
@habibun
habibun / .bashrc
Last active December 26, 2016 07:26
show branch name to terminal (add end of the bashrc file add this lines)
# show branch name
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOR="\[\033[0m\]"
@habibun
habibun / ClassesVersusObjects.js
Last active January 15, 2017 15:23
OLOO better supports the principle of separation of concerns
/**
* creating UI widgets (buttons, drop-downs, etc.)
*/
/**
* the “class” design in classic-style pure JS without any “class” helper library or syntax:
*/
// Parent class
function Widget(width, height) {
@habibun
habibun / SimplerDesign.js
Created January 17, 2017 15:47
OO vs OLOO
/**
* class-oriented design - OO
*/
// Parent class
function Controller() {
this.errors = [];
};
Controller.prototype.showDialog = function(title,msg) {
@habibun
habibun / .htaccess
Last active October 21, 2017 05:30
change document root folder cpanel (reactjs)
RewriteEngine on
RewriteCond %{HTTP_HOST} ^typing-challenge.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.typing-challenge.com$
RewriteCond %{REQUEST_URI} !build/
RewriteRule (.*) /build/$1 [L]