Skip to content

Instantly share code, notes, and snippets.

View markddavidoff's full-sized avatar
🎯
Focusing on Work, Sorry Side Projects

Mark Davidoff markddavidoff

🎯
Focusing on Work, Sorry Side Projects
View GitHub Profile
@mw3i
mw3i / django-database-standalone.py
Last active April 23, 2024 11:48
Truly Standalone Django-ORM Wrapper
'''
Proof of Concept:
Django devs built an ORM that seems way more straightforward than many existing tools. This class lets you leverage the django-orm without any project settings or other aspects of a django setup.
There are probably weak points and functionality missing, but it seems like a relatively intuitive proof of concept
'''
import os
import django
from django.conf import settings
@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
@markddavidoff
markddavidoff / prepare-commit-msg
Last active April 16, 2021 05:06
Git Commit Hook to add branch name to commit
# commit hook to prepend the JIRA ticket from the branch name to the commit
# Installation for one repo:
# - copy this file into your git repo's .git/hooks folder
# - make sure its executable:
# chmod a+x repo-path/.git/hooks/prepare-commit-msg
# Installation for all new repos: (you'll still have to do the above for already cloned repos)
# - tell git where your global hooks live:
# git config --global init.templatedir '~/.git-templates'
# - mkdir -p ~/.git-templates/hooks
# - copy this file to ~/.git-templates/hooks
@ghandic
ghandic / pil_s3.py
Last active March 15, 2024 14:16
Load image from S3 directly into memory as PIL image and write to S3 directly from memory from PIL image
import boto3
from PIL import Image
from io import BytesIO
import os
class S3ImagesInvalidExtension(Exception):
pass
class S3ImagesUploadFailed(Exception):
pass
@seanh
seanh / html_tags_you_can_use_on_github.md
Last active May 3, 2024 14:57
HTML Tags You Can Use on GitHub

HTML Tags You Can Use on GitHub

Wherever HTML is rendered on GitHub (gists, README files in repos, comments on issues and pull requests, ...) you can use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

But GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM syntactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

<details> and <summary>

A `<detai

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 16:19
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@rgl
rgl / wait_for_http_200.sh
Last active March 7, 2024 17:08
Wait for an HTTP endpoint to return 200 OK with Bash and curl
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9000)" != "200" ]]; do sleep 5; done'
# also check https://gist.github.com/rgl/c2ba64b7e2a5a04d1eb65983995dce76
@devdazed
devdazed / slack-pagerduty-oncall.py
Last active April 18, 2024 10:28
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@lmarkus
lmarkus / README.MD
Last active May 2, 2024 09:21
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@joar
joar / jq-insert-var.sh
Last active May 3, 2024 13:41
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{