Skip to content

Instantly share code, notes, and snippets.

@patrickfuller
patrickfuller / github_issues_to_csv.py
Last active November 30, 2022 10:03 — forked from unbracketed/export_repo_issues_to_csv.py
Export Issues from Github repo to CSV (API v3)
"""
Exports issues from a list of repositories to individual csv files.
Uses basic authentication (Github username + password) to retrieve issues
from a repository that username has access to. Supports Github API v3.
Forked from: unbracketed/export_repo_issues_to_csv.py
"""
import argparse
import csv
from getpass import getpass
import requests
@akiross
akiross / starlettews.py
Created March 16, 2019 18:35
A simple example of using websockets with starlette.io (it's super easy, wow!)
from starlette.applications import Starlette
from starlette.responses import HTMLResponse
from starlette.websockets import WebSocket
from jinja2 import Template
import uvicorn
template = """\
<!DOCTYPE HTML>
<html>
@butsjoh
butsjoh / gist:fbe4c824fef939f0911d
Last active March 26, 2022 12:21
Quill popover toolbar (when performing a selection it will show)
var QuillExtend = function(child, parent) { for (var key in parent) { if ({}.hasOwnProperty.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
PopoverToolbar = (function(superClass) {
QuillExtend(PopoverToolbar, superClass);
var _ = Quill.require('lodash');
var dom = Quill.require('dom');
// lodash has debounce but quill is not adding it in his dist
var debounce = function debounce(fn, quietMillis, ctx) {
@FBosler
FBosler / retry.py
Last active March 19, 2022 23:50
retry.py
#Copyright 2021 Fabian Bosler
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
@rca
rca / openldap_passwd.py
Last active January 21, 2022 14:00
Python hashing and test functions for user passwords stored in OpenLDAP.
#!/usr/bin/env python
"""
http://www.openldap.org/faq/data/cache/347.html
As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4
Author: Roberto Aguilar <roberto@baremetal.io>
"""
import hashlib
import os
@neilmayhew
neilmayhew / Identity-HowTo.md
Created December 16, 2021 18:26
Configuring git to use a different GitHub/GitLab identity for some projects

Using a different GitHub/GitLab account for some projects

If you're working on a project that requires you to use a separate account on GitHub/GitLab, it can be a bit tricky to set up. Your ssh key identifies you uniquely, so you can't use the same key for two different accounts. However, git doesn't have a simple way for you to configure an ssh key for a repo or a group of repos. You have to do it by creating an alias for the host name and associating a different key with that host name. Here's one way to do it.

Note: Replace all instances of something with the project or client name.

Create a new ssh key

ssh-keygen -f ~/.ssh/id_rsa-something [other-options]
@chrisklaiber
chrisklaiber / SimpleHTTPServer6.py
Created February 15, 2018 16:16
Python SimpleHTTPServer over IPv6. Run as `python -m SimpleHTTPServer6 [PORT]`
import BaseHTTPServer
import SimpleHTTPServer
import socket
class HTTPServer6(BaseHTTPServer.HTTPServer):
address_family = socket.AF_INET6
if __name__ == '__main__':
@alexellis
alexellis / inlets-kind.md
Last active January 19, 2021 07:19
Expose Kubernetes ClusterIP services with inlets.dev

KinD with inlets.dev

Expose Kubernetes ClusterIP services with inlets.dev

Get KinD:

# Linux

sudo curl -Lo /usr/local/bin/kind \