Skip to content

Instantly share code, notes, and snippets.

Avatar

Leo Tytakoff tytakoff

View GitHub Profile
@tytakoff
tytakoff / script.py
Created Nov 2, 2020 — forked from harshityadav95/script.py
Initialise CUDA environment on Google Colab
View script.py
!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
View 1192-critical-connections
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()
@tytakoff
tytakoff / ideas-for-startups-dropdown-reading.md
Created Feb 16, 2020 — 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
View ideas-for-startups-dropdown-reading.md

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.
@tytakoff
tytakoff / countries.js
Last active Jul 17, 2017
Countries list formatted for JavaScript (with country codes)
View countries.js
let countries = [
{
'name': 'Afghanistan',
'code': 'AF'
},
{
'name': 'Åland Islands',
'code': 'AX'
},
{
@tytakoff
tytakoff / 0_reuse_code.js
Created May 12, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:6dcb85cee711033ade4f
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"} }
@tytakoff
tytakoff / .bashrc
Created Jul 30, 2014
Useful bash commands
View .bashrc
# 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'
You can’t perform that action at this time.