Skip to content

Instantly share code, notes, and snippets.

View KatherineMichel's full-sized avatar
💭
Eating ice cream or wishing I had some 🍨

KatherineMichel

💭
Eating ice cream or wishing I had some 🍨
View GitHub Profile
https://github.com/abrenaut/python-cheat-sheet
https://github.com/kjordahl/pythonic
https://github.com/geokai/class_dev_toolkit_hettinger
https://github.com/sanjanasekar/python_for_engineers_part3
https://github.com/sdodda/pybay
https://github.com/astar/big_ideas
https://github.com/sankalp58/pycon_raymond_hettinger
https://github.com/ZacharyRSmith/py-thinking-about-concurrency
https://github.com/jurekkow/raymonds-trinity
https://github.com/ilyarudyak/modernpython
@david-crespo
david-crespo / README.md
Last active February 15, 2023 21:30
Download FB tagged photos and videos

Download photos and videos you're tagged in on Facebook

Why

When you download an archive of your Facebook account, Facebook includes photos and videos you've uploaded, but not photos and videos you're tagged in that were uploaded by other people. This is a script to automatically download those.

Setup

This requires Python 3.

@rothgar
rothgar / install.sh
Created April 4, 2018 17:07
Code on Chromebook
#!/bin/sh
# Follow instructions here to enable dev mode and start VM
# https://github.com/lstoll/cros-crostini/blob/master/README.md
sudo apt-get update
sudo apt-get install -y libasound2 libxss1 wget
wget -qO- https://go.microsoft.com/fwlink/?LinkID=620884 | tar xvz
# Launch code
s = status --short --branch --ignore-submodules=untracked
find = log --pretty=\"format:%Cgreen%H\n%s\n\n%b\" --name-status --grep
amend = commit --amend --no-edit
undo = reset HEAD~
upload = "!git push rakyll $(git rev-parse --abbrev-ref HEAD)"
prune = "!git co master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
delete = branch -D
pr = "!git fetch origin pull/$1/head:pr$1"
sync = "!git pull -q -r origin master"
@ErikAugust
ErikAugust / spectre.c
Last active April 15, 2024 13:55
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif
@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@stevenrich-zz
stevenrich-zz / 278requests.py
Created April 1, 2017 00:39
Automating Personal Financial Disclosure requests to White House
import csv, time
from selenium import webdriver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
applicant_name = # your name
applicant_email = # your email
applicant_address = # your physical address
occupation = # your occupation
@apollo13
apollo13 / chromelogger.py
Last active May 12, 2022 01:09
Django logging to Firefox/Chrome devtools
"""
License: MIT - https://opensource.org/licenses/MIT
ChromeLogger is a protocol which allows sending logging messages to the Browser.
This module implements simple support for Django. It consists of two components:
* `LoggingMiddleware` which is responsible for sending all log messages
associated with the request to the browser.
* `ChromeLoggerHandler` a python logging handler which collects all messages.
@nternetinspired
nternetinspired / output-articles-by-collection.liquid
Last active April 25, 2021 02:17
Loop through Jekyll collections and output their content as sections and articles
{% comment %}
Loops though every collection you defined in _config.yml and grabs the pages they contain; outputting title and full text with good basic html semantics.
Use page.excerpt instead of page.content to grab the first paragraph, blog list style. Markdownify is optional, depends how you authored content in your collections; I typically use Markdown.
{% endcomment % }
{% for collection in site.collections %}
{% assign name = collection.label %}
<section>
Benchmark results:
Date: 2016/03/20
Version: asgi_redis 0.8.3 / daphne master / channels master / cpython 2.7.11
Environment: AWS, 3x m3.large (1 daphne, 1 worker, 1 redis)
Source: 1x m3.medium, different AZ, ab for HTTP, channels benchmarker for WS
HTTP GET, Django View (concurrency 10, 10,000 total)
Failures: 0.0%
Rate: 160 req/s