Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

David Cramer dcramer

💭
I may be slow to respond.
View GitHub Profile
View gist:e9a9225dcdeffa8fd7fafbe283bf0cf6
apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
name: zeus-ci
spec:
domains:
- zeus.ci
- updates.zeus.ci
---
apiVersion: extensions/v1beta1
View Brewfile
# get some languages
brew 'go'
brew 'node'
brew 'python'
brew 'ruby'
# and common dlls
brew 'geoip'
brew 'libxmlsec1'
brew 'openssl'
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
source <(antibody init)
antibody bundle < ~/.config/zsh_plugins
# TODO(dcramer): literally doesnt work at all
# function update_antibody() {
# antibody bundle < ~/.config/zsh_plugins > ~/.config/zsh_plugins.sh
# }
@dcramer
dcramer / cramermath.py
Created Mar 29, 2019 — forked from mattrobenolt/cramermath.py
David Cramer math
View cramermath.py
"""
cramermath
~~~~~~~~~~
Usage:
>>> import cramermath
>>> cramermath.log(10)
0.014728067495500818
"""
View gist:6abbf037a51bc342f512724c889b2dc0
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuJUzqmnQCHvvgqJgAxew3qqrJtNQp3Ap1T0Bu4LFSLJ1ysSOFkC0v1eCmmNrLvUf7WYRmDBDC0aH8pxKFjE1CFZqolJFlp469aVaOcsqP3dfERGuWZ2zXokZjZr88CDmja7QVQ1l9gevnftHxy9rgov2mNdRqpJZpNcgct+0JvyFeJKhaCcyX2nYK5G0qe8FDub1azT3E/Ey3g/NvNzbmyqjDdIEU5hJo5J2uDGq26gXrudzJ/iARl7vJrvn160VNIn+tUvsejyc8UuqwIxu/4GVzKRcENJJUOg0GYhkIss7++ZbvvnINxbDi9wCgf8C5IQ4MD6Pp6dlvdihov6Np dcramer@MacBook-Pro-4.local
View base_job.py
class BaseJobResource(Resource):
def dispatch_request(
self, provider: str, owner_name: str, repo_name: str, build_number: int, job_number: int, *args, **kwargs
) -> Response:
queryset = Job.query.join(Build, Build.id == Job.build_id).join(
Repository, Repository.id == Build.repository_id
).filter(
Repository.provider == RepositoryProvider(provider),
Repository.owner_name == owner_name,
Repository.name == repo_name,
View componentToString.js
import ReactDOM from 'react-dom';
const componentToString = function(node) {
let el = document.createElement('div');
ReactDOM.render(node, el);
return el.innerHTML;
};
View gist:93a088759f532c3a398f
>>> import subprocess
>>> proc = subprocess.Popen(['git', 'clone', 'git@github.com:getsentry/sentry.git', '/tmp/ds-repo-1'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
>>> print(proc.communicate())
("Cloning into '/tmp/ds-repo-1'...\n", None)
View gist:099511a7a8f9efab7517
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'handlers': {
'console': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'simple',
},
'sentry': {
You can’t perform that action at this time.