Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / currency_change_calculator.py
Last active December 13, 2018 18:17
Currency Calculator
import sys
class CurrencyCalculator:
def __init__(self, check_cash):
self.check_cash = check_cash
# base_cash should be sorted list with highest currency denomination to lowest
self.base_cash = [100, 50, 20, 10, 5, 1]
self.result = self._breakdown()
@ssbozy
ssbozy / dribbble_aco_parser.py
Created November 30, 2018 04:32
Dribbble ACO file parser
import struct
import requests
class ColorSwatch():
def __init__(self, fp):
self.rawdata = struct.unpack(">5H",fp.read(10))
namelen, = struct.unpack(">I",fp.read(4))
cp = fp.read(2*namelen)
self.name = cp[0:-2].decode('utf-16-be')
self.typename = self.colorTypeName()
@ssbozy
ssbozy / py_aco_swatch_parser.py
Last active November 21, 2018 07:30
Dribble ACO File Parser in Python 2.7
import struct
class ColorSwatch():
def __init__(self, fp):
self.rawdata = struct.unpack(">5H",fp.read(10))
print self.rawdata
namelen, = struct.unpack(">I",fp.read(4))
cp = fp.read(2*namelen)
self.name = cp[0:-2].decode('utf-16-be')
self.typename = self.colorTypeName()
@ssbozy
ssbozy / ubuntu update.txt
Created November 19, 2018 02:26
This is a test for ubuntu
sudo apt-get clean
sudo apt-get update
"\e[A": history-search-backward
"\e[B": history-search-forward
set completion-ignore-case on
set show-all-if-ambiguous on
TAB: menu-complete
@ssbozy
ssbozy / schematest.py
Created March 22, 2018 18:29
python json-schema testing
import jsonschema
import sys
# A sample schema, like what we'd get from json.load()
schema = {
"type" : "object",
"properties" : {
"price" : {"type" : "number"},
"name" : {"type" : "string"},
"details":{

Keybase proof

I hereby claim:

  • I am ssbozy on github.
  • I am ssbozy (https://keybase.io/ssbozy) on keybase.
  • I have a public key ASASFJaNN_SP7cV1ie1XtSANnO3hU_spmXMlIWGj58l5cQo

To claim this, I am signing this object: