This file contains 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
# A script to download all the videos from | |
# https://archive.org/details/ucberkeley-webcast-PL3E89002AA9B9879E?sort=titleSorter | |
# python3.7 | |
# pip3 install --user selenium youtube-dl | |
import youtube_dl | |
from selenium import webdriver | |
driver = None |
This file contains 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
# python3 aiofiles_test.ty some_file_with_newlines | |
import sys | |
import asyncio | |
import aiofiles | |
async def read(filename): | |
async with aiofiles.open(filename, mode='r') as f: | |
return await f.read() |
This file contains 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
class Library: | |
def a(self, n): | |
print('a' * n) | |
def b(self, n): | |
print('b' * n) | |
class Extender(Library): |
This file contains 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
#!/usr/bin/env python3 | |
import time | |
from ratelimit import limits | |
from backoff import on_exception, fibo | |
import requests | |
LIMIT = 10 | |
WITHIN_TIME = 15 |
This file contains 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
defmodule Basic do | |
use GenServer | |
# starts the process | |
def start_link do | |
GenServer.start_link(__MODULE__, "Hello") | |
end | |
# initializes data for process | |
def init(initial_data) do |
This file contains 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
""" | |
Install bext by doing this stuff | |
Linux | |
Mac | |
""" | |
import sys, random, time |
This file contains 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
<?php | |
function getScoredBy($scoredBy): | |
{ | |
$scoredByNum = str_replace( | |
[',', ' users', ' user'], | |
'', | |
$scoredBy | |
); |
This file contains 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
#!/bin/bash | |
# Backs up stuff from my server | |
# run with https://sean.fish/d/housekeeping?dark | |
BACKUP_LOG='/tmp/backup.log' | |
mv "${HOME}/.cache/backup_dir.tar.gz" "${HOME}/.cache/backup_dir.tar.gz.bak" | |
date >> /tmp/backup.log | |
ssh vultr "~/vps/backup" >> "${BACKUP_LOG}" && \ | |
scp vultr:~/vps/backup_dir.tar.gz "${HOME}/.cache" >> "${BACKUP_LOG}" |
This file contains 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
$ remsync assets elm.json | |
'assets' -> '/home/sean/.local/share/remsync/assets' | |
'assets/Montserrat-BoldItalic.ttf' -> '/home/sean/.local/share/remsync/assets/Montserrat-BoldItalic.ttf' | |
'assets/favicon' -> '/home/sean/.local/share/remsync/assets/favicon' | |
'assets/favicon/apple-touch-icon.png' -> '/home/sean/.local/share/remsync/assets/favicon/apple-touch-icon.png' | |
'assets/favicon/favicon-32x32.png' -> '/home/sean/.local/share/remsync/assets/favicon/favicon-32x32.png' | |
'assets/favicon/favicon-16x16.png' -> '/home/sean/.local/share/remsync/assets/favicon/favicon-16x16.png' | |
'assets/favicon/favicon.ico' -> '/home/sean/.local/share/remsync/assets/favicon/favicon.ico' | |
'assets/favicon/android-chrome-192x192.png' -> '/home/sean/.local/share/remsync/assets/favicon/android-chrome-192x192.png' | |
'assets/favicon/android-chrome-512x512.png' -> '/home/sean/.local/share/remsync/assets/favicon/android-chrome-512x512.png' |
This file contains 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
#!/usr/bin/env python | |
# | |
# Copyright (c) 2017, Piotr Przymus | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |