Skip to content

Instantly share code, notes, and snippets.

View arifmahmudrana's full-sized avatar

Arif Mahmud Rana arifmahmudrana

View GitHub Profile
@arifmahmudrana
arifmahmudrana / readline.js
Created November 17, 2019 15:43
Read a file line by in node.js
const fs = require('fs'); // file system package
const rl = require('readline'); // readline package helps reading data line by line
// create an interface to read the file
const rI = rl.createInterface({
input: fs.createReadStream('/path/to/file') // your path to file
});
rI.on('line', line => {
console.log(line); // your line
});
@arifmahmudrana
arifmahmudrana / destructuring.js
Created October 26, 2017 08:50 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@arifmahmudrana
arifmahmudrana / files.json
Last active January 19, 2017 12:19
A curated file extension & file type list scraped from openoffice(https://www.openoffice.org/dev_docs/source/file_extensions.html)
{"files":[{"file_extension":".a","file_type":"UNIX static library file."},{"file_extension":".asm","file_type":"Non-UNIX assembler source file."},{"file_extension":".asp","file_type":"Active Server Page."},{"file_extension":".awk","file_type":"An <code>awk</code> script file."},{"file_extension":".bat","file_type":"MS-DOS batch file."},{"file_extension":".bmp","file_type":"Bitmap image file."},{"file_extension":".btm","file_type":"4NT batch file."},{"file_extension":".BTM","file_type":"4NT batch file."},{"file_extension":".c","file_type":"C language file."},{"file_extension":".class","file_type":"Compiled java source code file."},{"file_extension":".cmd","file_type":"Compiler command file."},{"file_extension":".CPP","file_type":"C++ language file."},{"file_extension":".csv","file_type":"Comma-separated value file."},{"file_extension":".cur","file_type":"Cursor image file."},{"file_extension":".cxx","file_type":"C++ language file."},{"file_extension":".CXX","file_type":"C++ language file."},{"file_extension":"
@arifmahmudrana
arifmahmudrana / git-repo-create
Created August 29, 2015 09:19
Step By Step how to create a github repo and tag for release
git clone Repository
cd Directory
Then create branch from github
git fetch
git checkout dev
git status
git add --all
git commit -m 'initial commit'
<!DOCTYPE HTML>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<title>Dynamic Pagination w/ Filtering</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Kim Maida">
<!-- JS Libraries -->
@arifmahmudrana
arifmahmudrana / index.html
Created June 2, 2015 11:39
ngMessages Example
<!DOCTYPE html>
<html ng-app="app">
<head>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<style>
html, body {
position:relative;
background:url(focus.png);
}
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@arifmahmudrana
arifmahmudrana / List.md
Last active August 29, 2015 14:13 — forked from msurguy/List.md

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):