Skip to content

Instantly share code, notes, and snippets.

View zaaath's full-sized avatar

Leo Toff zaaath

View GitHub Profile
@zaaath
zaaath / launch.json
Created October 31, 2021 19:18
toydb debugging in VS Code (configuration for the engine)
...
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'toydb'",
"cargo": {
"args": [
"build",
"--bin=toydb",
"--package=toydb"
@zaaath
zaaath / launch.json
Last active October 31, 2021 19:17
toydb debugging in VS Code (for toysql and unit tests only)
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'toydb'",
@zaaath
zaaath / script.py
Created November 2, 2020 23:38 — forked from harshityadav95/script.py
Initialise CUDA environment on Google Colab
!apt-get --purge remove cuda nvidia* libnvidia-*
!dpkg -l | grep cuda- | awk '{print $2}' | xargs -n1 dpkg --purge
!apt-get remove cuda-*
!apt autoremove
!apt-get update
!wget https://developer.nvidia.com/compute/cuda/9.2/Prod/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64 -O cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64.deb
!apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
!apt-get update
from collections import deque
class Solution:
def bfsNodes(n: int, adj_list: List[List[int]]) -> int:
if len(adj_list[0]) == 0:
return 0
visited = set()
q = deque([0])
while q:
curr_node = q.pop()
@zaaath
zaaath / ideas-for-startups-dropdown-reading.md
Created February 16, 2020 23:04 — forked from marcospgp/ideas-for-startups-dropdown-reading.md
Experimenting with a new way of reading long form text with Paul Graham's Ideas For Startups

Ideas For Startups

Written by Paul Graham and copied from http://www.paulgraham.com/ideas.html

October 2005

(This essay is derived from a talk at the 2005 Startup School.)

People think it's hard to come up with good ideas for startups because they don't actually try to do it.
@zaaath
zaaath / countries.js
Last active July 17, 2017 14:56
Countries list formatted for JavaScript (with country codes)
let countries = [
{
'name': 'Afghanistan',
'code': 'AF'
},
{
'name': 'Åland Islands',
'code': 'AX'
},
{
@zaaath
zaaath / 0_reuse_code.js
Created May 12, 2017 18:44
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zaaath
zaaath / gist:6dcb85cee711033ade4f
Last active August 29, 2015 14:14
Useful MacOS Apps
Windows Manager: Spectacle
Terminal: iTerm 2
https://github.com/taydakov/dotfiles
Sublime Text plugins: gitgutter, emmet, predawn theme, sublimetext-markdown-preview, sublimelinter, Web Inspector
Alt+M shortcut conf: { "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} }
@zaaath
zaaath / .bashrc
Created July 30, 2014 19:00
Useful bash commands
# Custom initializing commands (add to the end of ~/.bashrc)
sub() {
/home/lev/Sublime\ Text\ 2/sublime_text $1 1>/dev/null 2>/dev/null &
}
echo 'sub <file> -> open file in sublime'