Skip to content

Instantly share code, notes, and snippets.

from import tsdb
from datetime import timedelta
end =
month_event_total = tsdb.get_sums(
start=end - timedelta(days=30),
ehfeng /
Created April 28, 2017 01:21
Sentry OSS Contributors
import requests
usernames = set()
repos = set(['sentry', 'sentry-plugins' , 'sentry-docs', 'sentry-php', 'raven-python', 'raven-java', 'symbolserver', 'sentry-swift', 'raven-js', 'sentry-symfony', 'react-native-sentry', 'raven-node', 'sentry-elixir', 'raven-ruby', 'sentry-cli', 'fastlane-plugin-sentry', 'homebrew-tools', 'raven-csharp', 'sentry-laravel', 'sentry-auth-github', 'sentry-relay', 'sentry-rust', 'raven-aiohttp', 'sentry-gitlab', 'raven-swift', 'sentry-objc', 'sentry-irc', 'perl-raven', 'sentry-auth-google', 'sentry-orbital', 'sentry-trello', 'sentry-youtrack', 'sentry-zendesk-app', 'sentry-bitbucket', 'sentry-jira', 'sentry-pushover', 'sentry-github', 'sentry-pivotal', 'sentry-hipchat-ac', 'sentry-pagerduty', 'sentry-teamwork', 'raven-objc', 'sentry-redmine', 'raven-php', 'sentry-phabricator', 'sentry-flowdock', 'raven-django', 'sentry-webhooks'])
for repo in repos:
for contrib in requests.get('' % repo).json():
from threading import Thread
import time
def stuff():
print('in thread')
print('ending thread')
t = Thread(target=stuff)
ehfeng /
Created July 30, 2018 22:52
Scrubbing sensitive data with Sentry's Python SDK
from flask import Flask
from raven.contrib.flask import Sentry
app = Flask(__name__)
# To remove all client-side processors
# app.config['SENTRY_PROCESSORS'] = tuple()
# To specify which processors you'd like to use (because the raven flask plugin does not allow for a `processor` arg)
# app.config['SENTRY_PROCESSORS'] = ('raven.processors.SanitizePasswordsProcessor', )
{"code": "var Raven = require('raven');\nRaven.config('').install();\ntry {\n doAnotherThing(a[0]);\n} catch (e) {\n Raven.captureException(e);\n}"}
echo "{\"filename\": \"\", \"code\": \"from raven import Client\n\nclient = Client('')\n\ntry:\n 1 / 0\nexcept ZeroDivisionError:\n client.captureException()\n\nprint('testing print')\n\"}" | http POST
package main
import (
var script string = `
package main
import (
v8 ""
ehfeng / nginx.conf
Created July 10, 2022 21:11
Mapping requests to localhost servers based on Accept header
events {
worker_connections 1024;
http {
map $http_accept $accept {
default app;
~text/html web;
ehfeng / bigint.go
Created October 15, 2022 21:40
package bigint
import (