Skip to content

Instantly share code, notes, and snippets.

<!--
> Muaz Khan - www.MuazKhan.com
> MIT License - www.WebRTC-Experiment.com/licence
> Documentation - github.com/muaz-khan/RecordRTC
> and - RecordRTC.org
for converting to base64
audioElement.src = URL.createObjectURL(encoder.finish());
let reader = new window.FileReader();
@ManishLSN
ManishLSN / multipleCurl.php
Created May 2, 2018 10:52
call multiple curl with one script.
<?php
$url1 = 'https://api.giphy.com/v1/gifs/search?limit=15&q=he&api_key=xTiQyliBbaDfjlTkC4&rating=pg-13';
$url2 = 'https://api.iextrading.com/1.0/stock/MSFT/quote';
$url3 = 'https://api.iextrading.com/1.0/stock/GOOGL/quote';
$nodes = array($url1, $url2, $url3);
$node_count = count($nodes);
@ManishLSN
ManishLSN / asdf
Created March 30, 2018 13:22
asdf
<?php
//require_once('/path/to/stripe-php/init.php');
require_once('init.php');
/*
\Stripe\Stripe::setApiKey('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// $charge = \Stripe\Charge::create(['amount' => 120, 'currency' => 'usd', 'source' => 'tok_189fqt2eZvKYlo2CTGBfg6Yq']);
$charge = \Stripe\Charge::create(['amount' => 120, 'currency' => 'usd', 'source' => 'tok_1CBKi82eZvKYlo2CPEQwkA0a']);
*/
@ManishLSN
ManishLSN / installletsencrypt.sh
Created March 12, 2018 12:59
install lets encrypt certificate for 90 days free
// INSTALL LETSENCRYPT ON UBUNTU 16.04
sudo apt update && sudo apt upgrade
# IGNORE if git already installed (to check git --version)
sudo apt-get install git
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
@ManishLSN
ManishLSN / basic pg table
Created February 23, 2018 13:20
basic users table
CREATE TABLE public.users
(
id serial NOT NULL,
email character varying(155),
pwd text NOT NULL,
u_name character varying(155),
f_name character varying(100),
l_name character varying(100),
dob timestamp without time zone NOT NULL,
platform smallint DEFAULT 0,
@ManishLSN
ManishLSN / .gitignore
Created February 22, 2018 09:12
gitignore file should have these file extensions
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
@ManishLSN
ManishLSN / makeThumb.php
Created January 16, 2018 03:49
make thumb of image from the php functions
<!DOCTYPE html>
<html>
<body>
<center>
<form action="ab1.php" method="post" enctype="multipart/form-data">
Select image to upload:
<input type="file" name="file"><br><br>
Desired width: <input type="text" name="desired_width"><br><br>
<input type="submit" value="Upload Image" name="submit">
</form>
@ManishLSN
ManishLSN / setHeaderbyAngularjs.js
Created December 29, 2017 10:36
set header in angular js application
//$window.location.reload();
//$state.go("login");
$cookies.put("token", response.token);
var value = $cookies.get("token");
/* $cookies.put("loginUserId", response[0].id);
$rootScope.loginUserId = $cookies.get("loginUserId"); */
localStorageService.set("loginUserId", response.id);
@ManishLSN
ManishLSN / danger_cmd.sh
Created December 27, 2017 11:43
Most Dangerous command in Linux
There are plenty of one line terminal commands that can prove to be exorbitantly dangerous.
1. The Delete Everything Command
rm -rf /
This command deletes everything it possibly can, including files on your hard drive and files on connected removable media devices. This command can be explained as follows:
rm – Remove the following files.
-rf – Run rm recursively.
@ManishLSN
ManishLSN / commands
Created December 27, 2017 06:14
willl keep all usefull commands here
# for setting node path in windows
setx NODE_PATH "%NODE_PATH%;C:\Users\winbdows 7\AppData\Roaming\npm\node_modules"