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 / js_hoisting.js
Last active November 14, 2017 14:59
Javascript hoisting example for Medium article
function hoist() {
a = 10;
console.log(a); //this will print '10'
var a;
}
hoist();
@me-shaon
me-shaon / sample_js.js
Created November 13, 2017 13:28
Sample Function Scope example for Medium Article
function testFunction() { //Scope 1: Starts here. This scope is created by the Function block
var a = 1;
if(true) { //This block is not creating any new Scope
var b = 2;
console.log(a, b); //'a', 'b' both is accessible here
}
console.log(b); //Though 'b' defined inside the 'if' block, it's still accessible here
@me-shaon
me-shaon / sample_c.c
Last active November 16, 2017 15:18
Sample Block Scope example for Medium article
void testFunction() { //Scope 1: Starts here. This scope is created by the Function block
int a = 1;
if(true) { //Scope 2: Starts here. This scope created by the 'if' block
int b = 2;
//a is available here, because it is inside of it's scope
printf("%d %d", a, b);
}//Scope 2: Ends here
@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;
}
@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 / 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_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
}

#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 / 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
@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"