Skip to content

Instantly share code, notes, and snippets.

View mshmsh5000's full-sized avatar

Matt Holford mshmsh5000

View GitHub Profile
table redirects {
"/Advocate": "https://www.dosomething.org/us/campaigns/suspended-what-advocate",
"/After-School": "https://www.dosomething.org/us/campaigns/mirror-messages",
"/Amplify": "https://www.dosomething.org/us/campaigns/suspended-what-amplify",
"/Andrea": "https://www.dosomething.org/us/campaigns/show-stress-whos-boss",
"/BootcampNYC": "https://www.eventbrite.com/e/dosomethingorg-social-impact-bootcamp-nyc-registration-37716035678",
"/Bootcamps": "https://www.dosomething.org/us/about/social-impact-bootcamp",
"/Boss": "https://www.dosomething.org/us/campaigns/show-stress-whos-boss",
}
@mshmsh5000
mshmsh5000 / environmental-variables.json
Created September 7, 2017 00:32
We Vote Server: Prebuilt environmental-variables.json
{
"_comment": "Note that WE_VOTE_SERVER_ROOT_URL should end without slash",
"WE_VOTE_SERVER_ROOT_URL": "https://localhost:8889",
"WEB_APP_ROOT_URL": "http://localhost:3000",
"TIME_ZONE": "US/Pacific",
"SERVER_IN_DEBUG_MODE": true,
"_comment": "local.py settings, including database",
"DATABASE_ENGINE": "django.db.backends.postgresql_psycopg2",
"DATABASE_NAME": "wevoteserver",
@mshmsh5000
mshmsh5000 / WeVoteServer-vagrant-prebuilt.md
Last active September 8, 2017 14:39
WeVoteServer: Prebuilt Vagrant box instructions

Introduction

Try this method if you want to develop on WeVoteServer locally, can use Vagrant with VirtualBox on your local machine, and don't want to or can't run Ansible host (this is especially for Windows users).

You'll end up with a prebuilt Vagrant box that's the same as if you have built the We Vote Ansible/Django/Vagrant project from scratch. For further documentation on what's installed, see that project's README.

Following these instructions, you will

  • Check out the WeVoteServer codebase to a directory
  • Create a Vagrant directory at the same level
@mshmsh5000
mshmsh5000 / Vagrantfile
Last active September 7, 2017 00:32
We Vote Server: Prebuilt Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "wevote-imported"
config.vm.define "wevoteserver-prebuilt", primary: true do |app|
@mshmsh5000
mshmsh5000 / Homestead.yaml
Created July 18, 2017 21:31
Homestead YAML file for code challenge
---
# You probably don't need to change this section, unless you've done fancy
# stuff elsewhere with local IP addresses.
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
# Path to your public SSH key:
@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

@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 / 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 / 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 / CHANGELOG.md
Created June 7, 2016 16:21
Phoenix Changelog 2016-06-07