Skip to content

Instantly share code, notes, and snippets.

View fredrikaverpil's full-sized avatar

Fredrik Averpil fredrikaverpil

View GitHub Profile
@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
@maratori
maratori / .golangci.yml
Last active February 27, 2025 18:33
Golden config for golangci-lint
# This file is licensed under the terms of the MIT license https://opensource.org/license/mit
# Copyright (c) 2021-2025 Marat Reymers
## Golden config for golangci-lint v1.64.5
#
# This is the best config for golangci-lint based on my experience and opinion.
# It is very strict, but not extremely strict.
# Feel free to adapt it to suit your needs.
# If this config helps you, please consider keeping a link to this file (see the next comment).
@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 January 15, 2025 12:59
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <[email protected]>
# 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 September 23, 2024 11:45
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:. \
@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 October 24, 2024 15:24
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 <[email protected]>
# Modifications by Charl Botha <[email protected]>
# * 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 February 6, 2025 04:09
(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 February 27, 2025 01:14
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