Skip to content

Instantly share code, notes, and snippets.

View jfilipe's full-sized avatar

Jason Filipe jfilipe

  • theScore, Wave
  • Toronto, Canada
View GitHub Profile
@jfilipe
jfilipe / index.html
Created June 13, 2012 19:29 — forked from ilyabo/index.html
D3 tooltip using jQuery tipsy
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="jquery.tipsy.js"></script>
<link href="tipsy.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="chart"></div>
@jfilipe
jfilipe / proxy_views.py
Created September 28, 2012 21:42 — forked from joeshaw/proxy_views.py
super-hacky flask proxy
# coding:utf-8
# Copyright 2011 litl, LLC. All Rights Reserved.
import httplib
import re
import urllib
import urlparse
from flask import Blueprint, request, Response, url_for
from werkzeug.datastructures import Headers
@jfilipe
jfilipe / gist:3802277
Created September 28, 2012 21:55 — forked from anjackson/gist:2888380
Making a Bottle app that routes to a proxy
import bottle
from wsgiproxy.app import WSGIProxyApp
# Remove "hop-by-hop" headers (as defined by RFC2613, Section 13)
# since they are not allowed by the WSGI standard.
FILTER_HEADERS = [
'Connection',
'Keep-Alive',
'Proxy-Authenticate',
'Proxy-Authorization',
@jfilipe
jfilipe / sidekiq_transfer.rake
Created January 15, 2018 18:25 — forked from jagthedrummer/sidekiq_transfer.rake
Rake task to transfer Sidekiq jobs from one redis instance to another
# This task should be run inside an environment that is already configured to connect to the redis
# instance that we're transfering AWAY FROM.
#
# The task should be handed the URL of the redis instance that we're MOVING TO.
#
# To run it and pass in the destination Redis you'd do something like this:
# rake sidekiq:transfer[redis://...]
#
# As jobs are added to the destination Redis, they're deleted from the source Redis. This
# allows the task to be restarted cleanly if it fails in the middle due to a network error
@jfilipe
jfilipe / vcl-regex-cheat-sheet
Created January 24, 2018 19:09 — forked from dimsemenov/vcl-regex-cheat-sheet
Regular expression cheat sheet for Varnish (.vcl). Examples of vcl regexp. Found here http://kly.no/varnish/regex.txt (by Kristian Lyngstøl)
Regular expression cheat sheet for Varnish
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX
regular expressions, for a complete guide, see: "man 7 regex"
Basic matching:
req.url ~ "searchterm"
True if req.url contains "searchterm" anywhere.
req.url == "searchterm"
@jfilipe
jfilipe / exclude.sql
Created February 7, 2018 17:38 — forked from fphilipe/exclude.sql
PostgreSQL EXCLUDE constraint
CREATE EXTENSION btree_gist;
CREATE TABLE room_reservations (
room_id integer,
reserved_at timestamptz,
reserved_until timestamptz,
canceled boolean DEFAULT false,
EXCLUDE USING gist (
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH &&
) WHERE (not canceled)
@jfilipe
jfilipe / google-form-to-github-issue.md
Created April 18, 2018 13:33 — forked from bmcbride/google-form-to-github-issue.md
Create a new GitHub Issue from a Google Form submission

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
@jfilipe
jfilipe / haproxy-stats
Created July 4, 2018 15:18 — forked from alq666/haproxy-stats
HAProxy metrics
0. pxname [LFBS]: proxy name
1. svname [LFBS]: service name (FRONTEND for frontend, BACKEND for backend,
any name for server/listener)
2. qcur [..BS]: current queued requests. For the backend this reports the
number queued without a server assigned.
3. qmax [..BS]: max value of qcur
4. scur [LFBS]: current sessions
5. smax [LFBS]: max sessions
6. slim [LFBS]: configured session limit
7. stot [LFBS]: cumulative number of connections
@jfilipe
jfilipe / onboarding.md
Created February 25, 2019 22:32
Content CORE Onboarding
@jfilipe
jfilipe / get_events_by_release_stage.js
Created May 29, 2023 13:21 — forked from ivansnag/get_events_by_release_stage.js
Loops through all projects and returns project name, release stage and event totals for a given number of days
// A rate limit may be hit - if so you will need to add some sleeps
const fetch = require('node-fetch');
const url = 'https://api.bugsnag.com/'
const auth_token = 'YOUR PERSONAL AUTH TOKEN'
const last_number_of_days = '100' // eg. 7 would return totals from the last week
let headers = {
headers: {