Skip to content

Instantly share code, notes, and snippets.

View me-shaon's full-sized avatar
💭
Learning...

Ahmed shamim me-shaon

💭
Learning...
View GitHub Profile
@me-shaon
me-shaon / virtual-host-ubuntu.txt
Last active October 30, 2016 10:02
Create Virtual Host in Apache Server (Ubuntu)
# Go to /etc/apache2/sites-available/
# Create a file with the name of the virtual host consisting the '.conf' extension. Like myproject.com.conf
# Put the following code on that file
<VirtualHost *:80>
ServerName myproject.com
ServerAlias www.myproject.com
DocumentRoot /var/www/html/file_path_of_the_project
<Directory /var/www/html/file_path_of_the_project>
Options -Indexes +FollowSymLinks +MultiViews
@me-shaon
me-shaon / CreateTrigger.php
Created December 25, 2016 05:05
Sample Laravel migration to create MySQL Trigger
<?php
use Illuminate\Database\Migrations\Migration;
class CreateTrigger extends Migration
{
public function up()
{
DB::unprepared('
CREATE TRIGGER tr_after_main_insert AFTER INSERT ON `main` FOR EACH ROW
@me-shaon
me-shaon / config-eslint-in-atom.md
Last active May 6, 2017 06:27
Configuring eslint in Atom Editor
  • Install linter plugin in Atom
  • Install linter-eslint plugin in Atom
  • Create a .eslintrc file in project root
  • If there is no package.json file already in the project root, create one using:
npm init
  • Run the following command to working with the 'google eslint rules'-
npm install --save-dev eslint eslint-config-google
@me-shaon
me-shaon / github-markdown-fixer.js
Last active April 15, 2020 23:29
Github markdown fixer script
const fs = require('fs');
const path = require('path');
const rootDir = process.argv[2] || __dirname; //Take the 'directory path' given in command line argument. Otherwise take the 'current directory'
//List of Regular Expressions need to apply
const changeRules = [{
//Header Elements fixers
'find': /^(#+)([^ #].+)$/,
'replaceWith': "$1 $2"
@me-shaon
me-shaon / github-markdown-fixer.py
Last active May 19, 2017 09:56
Github markdown fixer script in python
import sys
import os
import glob
import re
import codecs
def fixItRalph(dirPath):
#List of Regular Expressions need to apply
changeRules = [
{ 'find': r'^(#+)([^ #].+)$', 'replaceWith': r'\1 \2' }, #Header Elements fixers

#Header

###AnotherHeader

Lorem ipsum dolor sit amet, consectetur [Broken Link] (http://link_url) adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

@me-shaon
me-shaon / object_1.js
Last active November 7, 2017 12:37
Javascript Object 1
//following is an Javascript object
var person = {
firstName:"John",
lastName:"Doe",
age:50
}
@me-shaon
me-shaon / object_2.js
Created November 7, 2017 12:36
Javascript Object 2
var person = new Object(); //this is an object
//Adding dynamic properties to the 'person' object
person.firstName = "John";
person.lastName = "Doe";
person.age = 50;
@me-shaon
me-shaon / object_3.js
Last active November 7, 2017 12:44
Javascript Object 3
//This is known as constructor function or kind of a template for objects
function person(first, last, age) {
this.firstName = first;
this.lastName = last;
this.age = age;
}
var newPerson = new person("John", "Doe", 50); //this is a an object
@me-shaon
me-shaon / hello_world.cpp
Created November 9, 2017 15:06
Hello world C code
#include<stdio.h>
int main(){
printf("Hello world");
return 0;
}