Skip to content

Instantly share code, notes, and snippets.

View carsongee's full-sized avatar

Carson Gee carsongee

View GitHub Profile
@carsongee
carsongee / update_libc.yml
Last active August 29, 2015 14:14
ansible play to update libc6 for GHOST and reboot serially. works for rhel and debian based distros
- name: Update libc6 and reboot
hosts: all
sudo: yes
# Comment out to apply to all servers
serial: 1
tasks:
- name: "Install packages and update cache"
apt: name="{{ item }}" state=latest update_cache=yes
with_items:
@carsongee
carsongee / in_vs_for.py
Last active August 29, 2015 14:24
Python For loop vs in
def x_in_loop():
x = range(500)
for i in x:
if x == 253:
return True
return False
def x_in_range():
x = range(500)
return 253 in x
@carsongee
carsongee / mitx-stack-server-vars.yml
Created August 17, 2015 17:20
MITx stack server vars
edx_platform_repo: "https://github.com/mitocw/edx-platform.git"
edx_platform_version: "mitx-release"
edxapp_use_custom_theme: true
edxapp_theme_name: mitx
edxapp_theme_source_repo: 'https://{{ COMMON_GIT_MIRROR }}/mitocw/edx-theme.git'
edxapp_theme_version: 'mitx-loloadx'
EDXAPP_MKTG_URL_LINK_MAP:
CONTACT: !!null
FAQ: !!null
HONOR: !!null
@carsongee
carsongee / github_org_stats.py
Last active May 16, 2024 18:57
Grab Contributor Statistics for a Given GitHub Organization
#!/usr/bin/env python
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
@carsongee
carsongee / t.py
Last active December 10, 2020 23:59
Quick & dirty python timer for copy/paste perf. Handy for quick measurements of functions with the decorator or blocks with the context manager
from contextlib import contextmanager
from functools import wraps
from time import perf_counter
@contextmanager
def t(name: str):
start = perf_counter()
yield
print(f'TIMER {name}: {perf_counter() - start}')
@carsongee
carsongee / harness_url_parser.py
Created January 24, 2024 01:40
Harness URL Parser snippet
from typing import NamedTuple
from urllib.parse import urlparse
class HarnessPipeline(NamedTuple):
account: str
org: str
project: str
pipeline: str
@classmethod