Skip to content

Instantly share code, notes, and snippets.

View mihir-kumar-thakur's full-sized avatar

Mihir Kumar Thakur mihir-kumar-thakur

View GitHub Profile
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kenrett
kenrett / Selenium Cheat Sheet.md
Last active May 25, 2023 01:28
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active July 11, 2024 15:06
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@pawelztef
pawelztef / _flash.html.erb
Last active August 9, 2021 02:16
rails flash messages with bootstrap 4
<div class="container">
<% flash.each do |type, msg| %>
<div class="alert <%= bootstrap_class_for_flash(type) %> alert-dismissable fade show">
<%= msg %>
<button class="close" data-dismiss="alert">x</button>
</div>
<% end %>
</div>
@themikefuller
themikefuller / aes-gcm.js
Created October 15, 2018 02:07
AES-GCM Encryption and Decryption Examples using Web Crypto (subtle.crypto) JavaScript API
async function generateKey() {
return await crypto.subtle.generateKey({
"name":"AES-GCM",
"length":256
},true,['encrypt','decrypt']);
}
async function exportKey(key) {
return await crypto.subtle.exportKey('jwk', key);
}
@mihir-kumar-thakur
mihir-kumar-thakur / disable-keyboard-on-boot-ubuntu
Last active March 2, 2024 08:05
disable-keyboard-on-boot-ubuntu
Disable Laptop Keyboard in Ubuntu
Taken From :- https://blog.hostonnet.com/laptop-keyboard-ubuntu
To disable laptop built in keyboard in Ubuntu, first you need to identify the device id for keyboard.
Now run xinput –list command to get list of all input devices
hostonnet@pc4:~$ xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
@rishiip
rishiip / find-slots.rb
Last active June 3, 2021 04:07
How I made 10 line ruby script to get my 1st jab done! 🤷🏼
# District - Pune, Date - Today's date. You can modify it as per your requirement.
uri = URI.parse("https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/calendarByDistrict?district_id=363&date=#{Date.today.strftime('%d-%m-%Y')}")
results = Net::HTTP.get(uri)
results = JSON.parse(results).with_indifferent_access
availability = {}
results[:centers].each do |center|
# 1st condition - Checking Age
sessions = center[:sessions].select{ |c| c[:min_age_limit] == 18 }