Skip to content

Instantly share code, notes, and snippets.

@ssbozy
ssbozy / formatting_numbers.py
Last active December 13, 2018 18:12
print number in decimal, binary, hex, octa and formatted decimal in python
'''
{:x} = hex
{:b} = binary
{:o} = octa
{:.2} = upto 2 significant places
'''
for i in range(64):
print "{}-{:x}-{:b}-{:o}-{:.2} ".format(i,i,i,i,i*0.123)
@ssbozy
ssbozy / iremember.js
Created January 29, 2019 23:47
iRemember
// How to:
// 1) Login into https://icloud.com
// 2) Open the developer tools and execute this code in the console
// See more @ https://medium.com/bugbountywriteup/how-apple-stored-all-your-email-metadata-for-years-on-their-servers-2a61b1a3232d
const _API_URL='https://p18-mailws.icloud.com/wm/recents';
const _requestContacts = () => {
console.warn('Requesting your contacts...');
return fetch(_API_URL, {
method: 'POST',
headers: {
@ssbozy
ssbozy / tree_index.sh
Last active May 21, 2019 20:08
convert tree output of current folder to index.html so that a static webserver can pick it up
tree -H . -L 1 --noreport --charset utf-8 > index.html
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function getRandomColor() {
return {
r: Math.floor(Math.random() *255),
g: Math.floor(Math.random() *255),
b: Math.floor(Math.random() *255)
}
}
@ssbozy
ssbozy / custom_logger_function.py
Created January 21, 2022 17:10
simple python function to replicate logger module using print
'''
This is to test function calling and name fetching
'''
import inspect
from datetime import datetime
def slogger(mesg: str) -> None:
'''
uses the inspect module to print message with date and caller function
{
"meta": {
"theme": "elegant"
},
"basics": {
"name": "Sandilya Bhamidipati",
"label": "Engineering Leader at Adobe",
"image": "https://secure.gravatar.com/avatar/268186232a20e762ec60ce56da748b2a",
"summary": "Engineering leader with an experience of 14+ years in people management and software engineering. I have managed engineering teams building search, recommendation and predictive analytics services. My work has been published at various top-tier machine learning conferences as well as contributed to 40+ patents. I am interested in building engineering solutions in the areas of Applied Machine Learning, Data mining, Distributed Systems and Distributed Databases.",
"website": "https://www.sandilya.com",
@ssbozy
ssbozy / pandoc_website_v0.sh
Last active April 27, 2022 04:11
building a website from markdown files using pandoc
pandoc -s -f markdown -t html5 -B ../includes/header.html -A ../includes/footer.html -o ../dist/output.html ../posts/test1.md -H ../styles/pandoc.css
@ssbozy
ssbozy / pandoc_website_v1.sh
Created April 27, 2022 04:13
building a blog using pandoc and markdown files
#!/bin/sh
ROOT_FOLDER=`pwd`
POSTS_FOLDER="posts"
DIST_FOLDER="dist"
function create_destination() {
mkdir -p dist dist/assets dist/posts dist/pages
}
@ssbozy
ssbozy / rename.sh
Last active May 2, 2022 15:09
Renaming files using basename command.
#!/bin/bash
for file in *.md.html
do
mv "$file" "$(basename $file .md.html).html"
done