Skip to content

Instantly share code, notes, and snippets.

View mshmsh5000's full-sized avatar

Matt Holford mshmsh5000

View GitHub Profile
@mshmsh5000
mshmsh5000 / ds.org-contribs.txt
Created January 8, 2016 20:57
DoSomething.org GitHub contributions, 2015
TOTAL PROJECTS: 129
TOTAL CONTRIBUTIONS: 8461
BY PROJECT:
phoenix: 2218
LetsDoThis-iOS: 966
LetsDoThis-Android: 471
northstar: 379
voting-app: 365
aurora: 330
@mshmsh5000
mshmsh5000 / notes.md
Last active February 3, 2016 17:00
Monitoring notes

Dev round table: Monitoring strategy & tools

Monitoring framework doc: CORE PHOENIX EXPERIENCES

  • Nami: Walk through

Review of tools

StatHat

@mshmsh5000
mshmsh5000 / redirect.vcl
Created February 10, 2016 15:38
Fastly VCL for redirects stored in dicts
sub vcl_recv {
if (table.lookup(redirects, req.url)) {
error 777 "Moved";
}
#FASTLY recv
if (req.request != "HEAD" && req.request != "GET" && req.request != "FASTLYPURGE") {
return(pass);
@mshmsh5000
mshmsh5000 / gist:b4e60a6a75d28994affa
Created February 18, 2016 19:47
"mexico" in Phoenix code base
$ find . -type f -exec grep -Hni mexico {} \;
./CHANGELOG.md:33:- Campaign Content added by DS Mexico only appearing in Active view - not in Admin/Edit [\#5198](https://github.com/DoSomething/phoenix/issues/5198)
./CHANGELOG.md:228:- figure out how to proxy Mexico and Non-US/BR/MX user experience [\#5008](https://github.com/DoSomething/phoenix/issues/5008)
./CHANGELOG.md:289:- Set default language for brazil and mexico admin [\#4999](https://github.com/DoSomething/phoenix/issues/4999)
./CHANGELOG.md:374:- Brazil Admin/Mexico Admin should see edit tab on campaign view page [\#4951](https://github.com/DoSomething/phoenix/issues/4951)
./CHANGELOG.md:2162:- Hides non translatable fields from Mexico and Brazil admins [\#5004](https://github.com/DoSomething/phoenix/pull/5004) ([deadlybutter](https://github.com/deadlybutter))
./CHANGELOG.md:2242:- Adding Brazil and Mexico admin roles and perms [\#4776](https://github.com/DoSomething/phoenix/pull/4776) ([blisteringherb](https://github.com/blisteringherb))
./lib/modul
@mshmsh5000
mshmsh5000 / geoip-headers.vcl
Last active August 7, 2018 09:33
Fastly GeoIP header injection
# Request headers
sub vcl_recv {
set req.http.X-Fastly-Country-Code = geoip.country_code;
set req.http.X-Fastly-Country-Name = geoip.country_name;
set req.http.X-Fastly-City = geoip.city;
set req.http.X-Fastly-Latitude = geoip.latitude;
set req.http.X-Fastly-Longitude = geoip.longitude;
set req.http.X-Fastly-Region = geoip.region;
#FASTLY recv
@mshmsh5000
mshmsh5000 / CHANGELOG.md
Created June 7, 2016 16:21
Phoenix Changelog 2016-06-07
@mshmsh5000
mshmsh5000 / northstar.md
Last active June 20, 2016 20:27
Northstar roadmap notes

Northstar roadmap

Not in order of priority. Chronologically, OAuth integration & Auth evisceration need to be done before some other tasks, like social sign-on.

OAuth integration

  • Aurora Probably first client, this sprint: 20 June
  • Nightwing If not Aurora first, then this
  • Jubilee Not necessary this summer, but for eventual consistency
@mshmsh5000
mshmsh5000 / sergii-recover.js
Last active August 3, 2016 15:50
Sergii's recover script
!function(){function a(a,b){var c=document.createElement("div"),d=document.createDocumentFragment();c.innerHTML=a,function(){c.firstChild?(d.appendChild(c.firstChild),setTimeout(arguments.callee,0)):b(d)}()}$x(".//a[not(contains(@href, 'public/reportbacks'))]").forEach(function(a){a.parentNode.parentNode.style.display="none"}),$x(".//a[contains(@href, 'public/reportbacks')]").forEach(function(b){b.onclick=function(){return!1},b.style.color="black",b.style.textDecoration="none",b.style.cursor="text";var c=new XMLHttpRequest;c.addEventListener("load",function(c){var d=document.createElement("iframe");d.style.display="block",d.style.width="1000px",d.style.height="500px",b.parentNode.insertBefore(document.createElement("hr"),b.nextSibling),b.parentNode.insertBefore(d,b.nextSibling),d.contentWindow.decodeImage=function(){try{this.eval(function(a,b,c,d,e,f){if(e=function(a){return(a<b?"":e(parseInt(a/b)))+((a%=b)>35?String.fromCharCode(a+29):a.toString(36))},!"".replace(/^/,String)){for(;c--;)f[e(c)]=d[c]||e(c);d=[
@mshmsh5000
mshmsh5000 / request-id.vcl
Created September 28, 2016 15:29
Fastly VCL for X-Request-ID header
# Unique request ID header
sub vcl_recv {
set req.http.X-Request-ID = digest.hash_sha256(now randomstr(64) req.http.host req.url req.http.Fastly-Client-IP server.identity);
#FASTLY recv
}
@mshmsh5000
mshmsh5000 / ds-messaging-test.md
Last active April 27, 2018 13:06
DoSomething messaging engineer: Code test

Assignment

Create three components that interact:

  1. A web app that serves a form. The form should functionally and visually mimic our user registration form. The submit handler should send an event & the data payload to
  2. A queue that receives the event, where it can be retrieved by
  3. An event consumer, which emails the form data to a preset address that you and we can access (e.g., dscodetest@mailinator.com)

Details