This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, json | |
big = ["January", "March", "May", "July", "August", "October", "December"] | |
small = ["April", "June", "September", "November"] | |
class DateHasher(object): | |
""" duh... """ | |
def __init__(self, dayMultiplier=12, monthMultiplier=31): | |
self.dayMultiplier = dayMultiplier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import sqlite3 | |
import datetime | |
sqlite3.register_adapter(float, py2sql) | |
sqlite3.register_converter("pyTS", sql2py) | |
py2sql = lambda unix_epoch: str(datetime.datetime.fromtimestamp(unix_epoch)) | |
sql2py = lambda strTime: datetime.datetime.timestamp( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://download4.operacdn.com/ftp/pub/opera/desktop/40.0.2308.62/linux/opera-stable_40.0.2308.62_amd64.deb | |
sudo apt install apt-transport-https libcurl3 | |
sudo dpkg -i opera-stable_40.0.2308.62_amd64.deb | |
# press yes on prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list | |
sudo apt update | |
sudo apt install sublime-text | |
subl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global_config] | |
[keybindings] | |
[layouts] | |
[[default]] | |
[[[child1]]] | |
parent = window0 | |
type = Terminal | |
[[[window0]]] | |
parent = "" | |
type = Window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call plug#begin('~/.vim/plugged') | |
Plug 'vim-airline/vim-airline' | |
Plug 'https://github.com/vim-python/python-syntax.git' | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
" https://github.com/terryma/vim-multiple-cursors.git | |
call plug#end() | |
let g:python_highlight_all=1 | |
colorscheme brog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--understand what we are looking at | |
.tables | |
PRAGMA table_info(moz_bookmarks); | |
-- now take a look at the diagram connecting bookmarks and places @ http://www.forensicswiki.org/wiki/Mozilla_Firefox_3_History_File_Format | |
.headers on | |
.mode csv | |
.output exported-bookmarks | |
SELECT | |
bm.id, bm.type, bm.parent, bm.position, bm.title, pl.url, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
import random | |
import sqlite3 | |
conn = sqlite3.connect("test.db") | |
cur = conn.cursor() | |
cur.execute("CREATE TABLE testing (uuid BLOB, information TEXT)") | |
# this is the best way to store uuid in sqlite, blobs, see-- | |
# https://wtanaka.com/node/8106 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localStorage.jwt = 'header.payload.signature'; | |
let auth_fetch = function(api_url, token) { | |
let myHeader = new Headers(); | |
myHeader.append('Content-Type', 'json/application'); | |
myHeader.append('Authorization', 'Bearer ' + token); | |
let request = new Request(api_url, | |
{ method: 'GET' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
allows you to use switch case in python, like so | |
``` | |
... | |
x = 5 | |
... | |
... | |
with switch(x, locals()) as (case, default): | |
@case(4) |
OlderNewer