Skip to content

Instantly share code, notes, and snippets.

@tclancy
tclancy / django_management_profile.py
Last active January 3, 2023 22:18
Profiling Django Management Command
from cProfile import Profile
from django.core.management.base import BaseCommand
class ProfileEnabledBaseCommand(BaseCommand):
"""Enable profiling a command with --profile.
Requires child class to define _handle instead of handle.
via https://gist.github.com/dfrankow
"""
@mrkline
mrkline / c_sharp_for_python.md
Last active June 23, 2024 14:46
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@rigwild
rigwild / linkedinSpammers.js
Last active February 16, 2022 19:49
Tampermonkey script to remove spam companies from LinkedIn job search page
// ==UserScript==
// @name Remove spam companies
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Remove spam job postings from LinkedIn job search
// @author rigwild (https://github.com/rigwild)
// @match https://www.linkedin.com/jobs/search*
// @grant none
// ==/UserScript==