Skip to content

Instantly share code, notes, and snippets.

@jdahlin
jdahlin / generate-mypy-blacklist.md
Last active May 25, 2022 12:01
Use this script to generate a mypy.ini where you can enable strict mode based on errors from a current run.

Use this script to generate a mypy.ini where you can enable strict mode based on errors from a current run.

Needs a few improvments:

  • output pyproject.toml
  • update source files by adding # type: ignore[xxx] instead of ignore_errors
@rahatarmanahmed
rahatarmanahmed / difficult.txt
Created August 15, 2020 01:36
skribbl.io custom word lists
drought,professor,barber,kneel,orbit,germ,darts,dance,cape,beanstalk,sushi,baby-sitter,ping pong,mime,Heinz 57,half,swamp,sheep dog,macaroni,hurdle,Internet,lie,logo,rind,fireman pole,raft,wig,salmon,pigpen,letter opener,cabin,fireside,cell phone charger,dent,jungle,dripping,saddle,fabric,sleep,mirror,ski goggles,ringleader,scream,point,neighborhood,yardstick,applause,cliff,loveseat,sponge,chess,grandpa,peasant,cruise,CD,drawback,chestnut,yolk,pilot,season,bedbug,world,important,bleach,biscuit,bobsled,pharmacist,shampoo,swarm,moth,sneeze,deep,sunburn,pizza sauce,houseboat,password,dryer sheets,migrate,snag,koala,catalog,husband,darkness,shower curtain,rib,extension cord,honk,landscape,water buffalo,wooly mammoth,cheerleader,cloak,birthday,nightmare,fizz,clog,myth,wind,banister,post office,knight,rim,think,bride,comfy,hydrogen,baguette,vitamin,lace,tiptoe,sweater vest,pail,glitter,plow,retail,leak,pocket,crust,mascot,macho,hail,bargain,time machine,drain,vegetarian,bookend,ivy,taxi,foil,mast,gold,chime,commerc
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@dgovil
dgovil / windowPositions.py
Created January 21, 2017 04:08
Saving Window Positions in PyQt or PySide
# First lets import the two modules we'll need from Qt
from Qt import QtWidgets, QtCore
# Then we create our Window class, in this case from a QDialog
class MyWindow(QtWidgets.QDialog):
def __init__(self):
# We use the __init__ method to initialize it
# The super function gets the class we are inheriting from (in this case QDialog) and calls its' __init__ as well
@doubleyou
doubleyou / Makefile
Last active August 15, 2023 10:30
grpc-gateway python example
GATEWAY_FLAGS := -I. -I/usr/local/include -I$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis -I/usr/local/include
GRPC_FLAGS := --python_out=. --grpc_python_out=.
code:
python -m grpc_tools.protoc $(GRPC_FLAGS) $(GATEWAY_FLAGS) *.proto
gw:
protoc $(GATEWAY_FLAGS) \
--go_out=Mgoogle/api/annotations.proto=github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api,plugins=grpc:. \
@oznu
oznu / README.md
Last active April 30, 2024 20:58
How to Bootcamp / Dual Boot Windows 10 on a mid-2011 iMac using USB

How to Install / Bootcamp Windows 10 on a mid-2011 iMac using USB

Apple has released support for bootcamping Windows 10, but only on 2012 Macs and later. Despite not being supported. it is possible to install Windows 10 on earlier iMacs and it seems to run quite well.

IMPORTANT: Unplug all external and physical hard drives (where possible) that you won't be installing to to avoid accidentally erasing them. Also make note of which drives and partitions remain (e.g. System and Storage hard drives), and be super careful to not erase the wrong one.

RECOVERY: If you nuke your machine, restore your time machine backup. Instructions here.

Requirements

@bearfrieze
bearfrieze / comprehensions.md
Last active December 23, 2023 22:49
Comprehensions in Python the Jedi way

Comprehensions in Python the Jedi way

by Bjørn Friese

Beautiful is better than ugly. Explicit is better than implicit.

-- The Zen of Python

I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.

@cpbotha
cpbotha / pyside_dynamic.py
Last active January 17, 2024 05:39
pyside_dynamic.py with minor improvements - also see http://stackoverflow.com/a/14894550/532513
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# Copyright (c) 2011 Sebastian Wiesner <lunaryorn@gmail.com>
# Modifications by Charl Botha <cpbotha@vxlabs.com>
# * customWidgets support (registerCustomWidget() causes segfault in
# pyside 1.1.2 on Ubuntu 12.04 x86_64)
# * workingDirectory support in loadUi
# found this here:
# https://github.com/lunaryorn/snippets/blob/master/qt4/designer/pyside_dynamic.py
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active April 1, 2024 10:52
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@trusktr
trusktr / DefaultKeyBinding.dict
Last active April 21, 2024 06:32
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers