Skip to content

Instantly share code, notes, and snippets.

View amritpandey23's full-sized avatar
🎯

Amrit amritpandey23

🎯
View GitHub Profile
New-Item -ItemType File -Path $Profile -Force
// $Profile gives you the path
function prompt {
$dateTime = Get-Date -Format "dddd MMMM d h:mm tt"
"`e[32m$env:UserName@$env:UserDomain`e[0m`:`[`e[33m$($ExecutionContext.SessionState.Path.CurrentLocation)`e[0m] $dateTime`n> "
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Your Name</title>
<style>
#main {
max-width: 640px;
@amritpandey23
amritpandey23 / power.cpp
Created September 24, 2022 19:55
Power of a number using binary exponentiation
long long int power(int a, int b) {
long long int res = 1;
while (b > 0) {
if ((b & 1) == 1) {
res *= a;
}
a *= a;
b = (b >> 1);
}
return res;
sudo apt update -y
sudo apt install -y build-essential g++ python3 cmake python3-dev pkg-config sqlite3 python3-pip python3-setuptools
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3
sudo apt install -y autoconf cvs bzr unrar mercurial git
git clone https://gitlab.com/nsnam/bake
cd bake
./bake.py check
# install any missing python packages via
# pip3 install <package-name>
./bake.py configure -e ns-3.35
@amritpandey23
amritpandey23 / unlike.js
Created November 20, 2019 12:58
Unlike all tweets with JavaScript Script | Updated version 2019
/*procedure
1. Move to likes tab.
2. Scroll to the bottom of page.
3. Open console CMD+SHIFT+I.
4. Paste this script in console and hit enter(to run).
5. Keep paste/run it till you reach to the top.
*/
function main() {
btns = document.querySelectorAll("div[data-testid='unlike']");
btns.forEach(btn => btn.click());
@amritpandey23
amritpandey23 / multiproc_generate.py
Created October 22, 2019 13:42
Multiprocessing VS Simple Loop to generate and save 50 millions floating point numbers in a file with Python
from multiprocessing import Process
from random import random, seed
from time import time
from sys import argv
from os import cpu_count
file = open('data.txt', 'a+')
s = 1;
off = 1000;
n_procs = int(cpu_count())
@amritpandey23
amritpandey23 / gist:1c959009b9a6c5b2c42295b8e542c378
Created August 29, 2019 11:57 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@amritpandey23
amritpandey23 / van_eck.js
Created June 15, 2019 13:05
Van Eck Sequence Generator in JavaScript
// Van Eck Sequence v1.0
// What is Van Eck sequence? https://www.numberphile.com/videos/van-eck-sequence
const list = [0];
function generate(len = 100) {
if (len <= 0 || parseInt(len) === NaN) return console.log('invalid input');
let i = 0;
let start;
while (i <= len) {
@amritpandey23
amritpandey23 / hello.apt
Last active June 23, 2019 18:37
BASIC "PRINT" statement interpreter in JavaScript
print "Hello, World!"
print "It is so nice to meet you."
@amritpandey23
amritpandey23 / __init__.py
Last active January 20, 2019 14:18
GIST2019-01-20
from runyt.read import read_data
from runyt.download import download_data
download_data()
read_data()