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 / 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: {
@jfilipe
jfilipe / onboarding.md
Created February 25, 2019 22:32
Content CORE Onboarding
@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 / 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 / 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 / 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 / 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 / ar.rb
Created May 26, 2016 19:20
Displays ActiveRecord queries in the console as they happen.
# in a console session:
ActiveRecord::Base.logger = Logger.new(STDOUT)
@jfilipe
jfilipe / keybase.md
Created June 19, 2014 19:29
keybase.md

Keybase proof

I hereby claim:

  • I am jfilipe on github.
  • I am jfilipe (https://keybase.io/jfilipe) on keybase.
  • I have a public key whose fingerprint is 851D DE4A B21B 56FD 62B0 DBFE C7A2 1F04 B319 5AA1

To claim this, I am signing this object:

@jfilipe
jfilipe / gist:9834103
Last active August 29, 2015 13:57
Generate time based links for private bunches (nibbler.io).
import hmac
from hashlib import sha1
from time import time
NIBBLER_CUSTOMER_ID = 'xxx'
PRIVATE_BUNCH_NAME = 'xxx'
FILENAME = 'xxx'
LINK_EXPIRE_SECONDS = 60
NIBBLER_ACCESS_KEY = 'xxx'