Skip to content

Instantly share code, notes, and snippets.

View miketheman's full-sized avatar
🌴
On vacation

Mike Fiedler miketheman

🌴
On vacation
View GitHub Profile
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 22, 2024 11:45
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@nzakas
nzakas / gist:5511916
Created May 3, 2013 17:47
Using GitHub inside a company

I'm doing some research on how companies use GitHub Enterprise (or public GitHub) internally. If you can help out by answering a few questions, I'd greatly appreciate it.

  1. What is the primary setup? Is there an organization and each official repo is owned by that organization?
  2. Does every engineer have a fork of each repo they're working on?
  3. Are engineers allowed to push directly to the official repo? Or must all commits go through a pull request?
  4. Do engineers work on feature branches on the main repo or on their own forks?
  5. Do you require engineers to squash commits and rebase before merging?
  6. Overall, what is the workflow for getting a new commit into the main repository?
  7. What sort of hooks do you make use of?
  8. Are there any ops issues you encountered? (Scaling, unforeseen downtime, etc.)
@ifyoumakeit
ifyoumakeit / github-conventional-comments.js
Last active March 21, 2024 14:52
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",
@Daenyth
Daenyth / debug_requests.py
Created August 27, 2015 14:35
Enable debug logging for python requests
import requests
import logging
import httplib
# Debug logging
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
req_log = logging.getLogger('requests.packages.urllib3')
req_log.setLevel(logging.DEBUG)
@D2theR
D2theR / README.md
Last active February 28, 2024 17:34
Auto-generates Serializers & ModelViewSets in a Django API using just models

Why?

I got sick of writing the same Serializer & ModelViewSet classes over and over so I found and wrote some code to do it for me, and somehow it works! Please note that there are a lot of caveats to running an API like this and while this may work, I know there's A LOT of room for improvement, feel free to fork and help!

USAGE

Import the router module to your main sites urls.py file as the injection point like so... Make sure to remove any other imports from other viewsets that you don't need that may conflict!

@jayjanssen
jayjanssen / gist:4039319
Created November 8, 2012 15:02
sysctl tuning for HAproxy
net.core.somaxconn = 32768
net.ipv4.conf.all.send_redirects = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.tcp_abort_on_overflow = 0
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_max_tw_buckets = 262144
net.ipv4.tcp_mem = 200000    280000    300000
@schacon
schacon / gist:942899
Created April 26, 2011 19:19
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
@timlo
timlo / github-conventional-comments.js
Last active May 20, 2022 16:44 — forked from ifyoumakeit/github-conventional-comments.js
GitHub Conventional Comments (instructions to install in comment below code)
// https://github.com/settings/replies
// Settings > Saved Replies
// Execute in JS console.
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
@mitchellh
mitchellh / gist:1277049
Created October 11, 2011 01:30
Configure Vagrant VM to use Host DNS for VPN
Vagrant::Config.run do |config|
# ...
config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
@alekstorm
alekstorm / README.md
Last active April 23, 2020 19:00
Ansible callback plugin that posts events to your Datadog event stream as you deploy

Installation

To install, place datadog.py in your callback plugins directory. If you don't yet have one, run:

mkdir -p plugins/callback

Then place the following in your ansible.cfg file:

[defaults]

callback_plugins = ./plugins/callback