Skip to content

Instantly share code, notes, and snippets.

View akost's full-sized avatar
🏠
Working from home

Andrei K. akost

🏠
Working from home
  • Seattle, WA
  • 01:57 (UTC -08:00)
View GitHub Profile
@akost
akost / chase-deals-autoload.user.js
Last active November 20, 2025 21:40
Userscript: Add all deals to your Chase credit card
// ==UserScript==
// @name Chase: Add all deals to your Chase credit card
// @namespace http://tampermonkey.net/
// @version 2025-11-20
// @description Chase: Add all deals to your Chase credit card
// @author Andrei K
// @match https://secure.chase.com/web/auth/dashboard
// @icon https://www.google.com/s2/favicons?sz=64&domain=chase.com
// @grant none
// ==/UserScript==
@akost
akost / akost.zsh-theme
Created September 22, 2022 17:02
Oh-my-zsh Theme
# akost zsh theme
function get_pwd() {
print -D $PWD
}
function precmd() {
print -rP '
$fg_bold[green]%m$fg[white]:$(get_pwd)$reset_color $(git_prompt_info)'
}
@akost
akost / kids-20-inch-bike.md
Last active April 2, 2019 04:48
Kids 20" Bike Research

Kids' 20" inch bikes research (October 2018).

Requirements:

  • Good brand
  • Hand brakes (not a coaster brake)
  • Reasonable price
  • Multiple gears (except Cleary Bikes Owl)

Results:

@akost
akost / dfs-inorder.py
Created July 2, 2017 23:42
Depth-First Search for binary tree. In-order traversal
"""
Depth-First Search for binary tree
In-order traversal
"""
import unittest
class Node(object):
def __init__(self, data = None, left = None, right = None):
self.data = data
@akost
akost / bfs.py
Last active July 2, 2017 22:54
Breadth-First Search
"""
Breadth-First Search for binary tree
"""
import unittest
class Node(object):
def __init__(self, data = None, left = None, right = None):
self.data = data
self.left = left
@akost
akost / str_to_int.py
Last active July 2, 2017 18:02
Converts string to integer
"""
Convert string to integer
"""
import unittest
class TestStringMethods(unittest.TestCase):
def test1(self):
self.assertEqual(myInt("123"), 123)
@akost
akost / str_to_int.py
Last active July 2, 2017 16:27
Convert string to signed integer
"""
Convert string to integer
"""
import unittest
class TestStringMethods(unittest.TestCase):
def test1(self):
self.assertEqual(myInt("123"), 123)
"""
Detect a cycle in a linked list. Note that the head pointer may be 'None' if the list is empty.
A Node is defined as:
class Node(object):
def __init__(self, data = None, next_node = None):
self.data = data
self.next = next_node
"""
@akost
akost / hours.php
Created March 9, 2017 18:42
Ugly 12-hours formatting
<?php echo ($i <= 12) ? $i : (($i <= 24) ? ($i - 12) : ($i - 24)) ?><?php echo $i < 12 ? 'am' : ($i > 23) ? 'am' : 'pm' ?>
@akost
akost / gist:b1fc7189ea5dc291b79e
Created September 11, 2015 23:02
Bookmarklet to show all page headers
javascript:(function(){function%20read(url){var%20r=new%20XMLHttpRequest();r.open('HEAD',url,false);r.send(null);return%20r.getAllResponseHeaders();}alert(read(window.location))})();