Skip to content

Instantly share code, notes, and snippets.

Christopher DeCairos cadecairos

Block or report user

Report or block cadecairos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cadecairos
cadecairos / case.js
Created Sep 21, 2017
retrieveSubscription timeout with customer expand
View case.js
// this function process a webhook event received from Stripe
function(request, reply) {
var event = request.payload;
var charge = event.data.object;
if (event.type !== 'charge.succeeded') {
return reply('This hook only processes charge succeeded events');
}
@cadecairos
cadecairos / reclaimWindows10.ps1
Created Jan 11, 2017 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
View reclaimWindows10.ps1
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
View openbadges_redirects_S3.xml
<RoutingRules>
<RoutingRule>
<Condition>
<KeyPrefixEquals>earn/</KeyPrefixEquals>
</Condition>
<Redirect>
<ReplaceKeyPrefixWith>get-started/earning-badges/</ReplaceKeyPrefixWith>
<HttpRedirectCode>307</HttpRedirectCode>
</Redirect>
</RoutingRule>
View gist:2368d2582be4ccfd3715817922ba420d
Utils.generateUUID = function() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = (d + Math.random()*16)%16 | 0;
d = Math.floor(d/16);
return (c=='x' ? r : (r&0x7|0x8)).toString(16);
});
return uuid;
}
View gist:2535107a6c00291c44fae2ab94a9690e
commit 8b8d3239d7418f4225a5a6d722e1b257913bc1dc
Author: Mike Kamermans <pomax@nihongoresources.com>
Date: Mon Sep 26 10:33:05 2016 -0700
Hackfix (#2238)
* prevent WP hack attempts by locking down the stub format
* make sure we get JSON
View DNT_Check.js
function WebAnalytics() {
var _dntStatus = navigator.doNotTrack || navigator.msDoNotTrack;
var fxMatch = navigator.userAgent.match(/Firefox\/(\d+)/);
var ie10Match = navigator.userAgent.match(/MSIE 10/i);
var w8Match = navigator.appVersion.match(/Windows NT 6.2/);
View badges_issued_by_day.sql
SELECT
CAST(badge.validated_on AS DATE) AS day,
COUNT(*) AS 'Badges Issued'
FROM
badge
GROUP BY year(day), month(day), day(day);
View session_emails.js
const hatchet = require('hatchet');
const sessionData = require('./session_data.json');
sessionData.forEach((session) => {
hatchet.send("mozfest_session_proposal_2016", session, (err, response) => {
if (err) {
console.log("Failed to send proposal confirmation email.")
} else {
console.log(`Proposal confirmation email successfully sent to ${session.email}!`)
}
@cadecairos
cadecairos / upgrade_heroku_db.sh
Last active Sep 2, 2016
Script to automate database upgrades on Heroku
View upgrade_heroku_db.sh
#!/bin/bash
set -e
app=$APP_NAME
old_db_env_var=$OLD_DB_ENV_VAR
new_db_env_var=$NEW_DB_ENV_VAR
remove_addon_name=$REMOVE_ADDON_NAME
old_db_url=`heroku config:get -a $app $OLD_DB_ENV_VAR`
new_db_url=`heroku config:get -a $app $new_db_env_var`
View keybase.md

Keybase proof

I hereby claim:

  • I am cadecairos on github.
  • I am cadecairos (https://keybase.io/cadecairos) on keybase.
  • I have a public key whose fingerprint is AB41 5ACC 0180 A407 451F 3FE6 10E6 346E EE2F 659D

To claim this, I am signing this object:

You can’t perform that action at this time.