Skip to content

Instantly share code, notes, and snippets.

View riazXrazor's full-sized avatar
🏠
Working from home

Riaz Laskar riazXrazor

🏠
Working from home
View GitHub Profile
@riazXrazor
riazXrazor / zsh-elapsed-time.md
Created July 13, 2022 16:20 — forked from knadh/zsh-elapsed-time.md
Elapsed and execution time for commands in ZSH

Elapsed and execution time display for commands in ZSH

Append this to your ~/.zshrc file.

function preexec() {
 timer=$(($(date +%s%0N)/1000000))
@riazXrazor
riazXrazor / gist:857f4a385762bd30d3ca0cf0b8ca95cc
Created August 10, 2021 10:47
Nodejs Script to Upload Files to AWS S3
const fs = require('fs');
const path = require('path');
const AWS = require('aws-sdk');
// to be filled by user
const env = {
MY_ACCESS_ID : '',
MY_ACCESS_SECRET_KEY: '',
MY_ACCESS_REGION: "ap-south-1",
MY_BUCKET_NAME: ''
@riazXrazor
riazXrazor / FP.js
Created March 24, 2021 09:01
Calculate Average of numbers in an array in a functional way
// Helpers
// ----------------------------------------------------------------------------
const filter = p => a => a.filter(p);
const map = f => a => a.map(f);
const reduce = r => i => a => a.reduce(r, i);
// Lift for functions. to understand this use below link 👇
// See: https://jrsinclair.com/articles/2019/compose-js-functions-multiple-parameters/
const lift = f => g => h => x => f(g(x))(h(x));
@riazXrazor
riazXrazor / HTTP_Status_Codes.txt
Created March 12, 2021 08:09
HTTP Status Codes
Status Codes
For details : https://httpstatuses.com/{HTTP_CODE}
1xx Information
100 Continue
101 Switching Protocols
102 Processing
@riazXrazor
riazXrazor / Description
Created November 16, 2020 12:03 — forked from Cannonb4ll/Description
Laravel Trait Make command
Place the TraitMakeCommand.php file inside App\Console\Commands
Place the trait.stub file inside App\Console\Commands\stubs
@riazXrazor
riazXrazor / avd.sh
Last active January 17, 2019 18:27 — forked from hidroh/avd.sh
Handy bash script to prompt for an Android virtual device (AVD) selection and launch it. Assuming that Android SDK has been set up and is in user PATH.
cd $HOME/Android/Sdk/tools
emulator -list-avds | cat -n
printf "Select AVD: "
read index
avd=$(emulator -list-avds | sed "${index}q;d")
echo "Selected $avd"
emulator -netdelay none -netspeed full -avd $avd &disown &exit
@riazXrazor
riazXrazor / ContextCmder-Disable.reg
Created July 9, 2018 08:22 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7/8
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@riazXrazor
riazXrazor / push_apns.php
Created June 26, 2016 18:20 — forked from SiriusDely/push_apns.php
Push Notification PHP Script - Apple iOS, Android C2DM, BlackBerry PPG
<?php
// Put your device token here (without spaces):
$deviceToken = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// Put your private key's passphrase here:
$passphrase = 'xxxxxxx';
// Put your alert message here:
$message = 'A push notification has been sent!';