Skip to content

Instantly share code, notes, and snippets.

View ctrlaltdylan's full-sized avatar

Dylan Pierce ctrlaltdylan

View GitHub Profile
@ctrlaltdylan
ctrlaltdylan / application.scss
Created March 16, 2017 14:20
Rails asset pipeline bootstrap-scss only import glyphicons
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
var private_key = postman.getEnvironmentVariable('private_key');
var public_key = postman.getEnvironmentVariable('public_key');
var method = request.method;
var content_type = 'application/json';
var content_md5 = '';
var request_url = request.url;
var request_uri = request_url.replace(/^.*\/\/[^\/]+/, '')
var timestamp = (new Date()).toGMTString();
@ctrlaltdylan
ctrlaltdylan / sendgrid_inbound_parse_webhook_example.json
Created July 6, 2018 20:31
SendGrid Inbound Parse Webhook Example
{
"headers": "Received: by mx0047p1mdw1.sendgrid.net with SMTP id 6WCVv7KAWn Wed, 27 Jul 2016 20:53:06 +0000 (UTC)
Received: from mail-io0-f169.google.com (mail-io0-f169.google.com [209.85.223.169]) by mx0047p1mdw1.sendgrid.net (Postfix) with ESMTPS id AA9FFA817F2 for <example@example.comom>; Wed, 27 Jul 2016 20:53:06 +0000 (UTC)
Received: by mail-io0-f169.google.com with SMTP id b62so81593819iod.3 for <example@example.comom>; Wed, 27 Jul 2016 13:53:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sendgrid.com; s=ga1; h=mime-version:from:date:message-id:subject:to; bh=DpB1CYYeumytcPF3q0Upvx3Sq/oF4ZblEwnuVzFwqGI=; b=GH5YTxjt6r4HoTa+94w6ZGQszFQSgegF+Jlv69YV76OLycJI4Gxdwfh6Wlqfez5yID 5dsWuqaVJZQyMq/Dy/c2gHSqVo60BKG56YrynYeSrMPy8abE/6/muPilYxDoPoEyIr/c UXH5rhOKjmJ7nICKu1o99Tfl0cXyCskE7ERW0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:sub
@ctrlaltdylan
ctrlaltdylan / deploy.sh
Created September 19, 2018 03:50
Deploying Wordpress with Ansible
ansible-playbook playbook.yml -i hosts.yml -u ubuntu
@ctrlaltdylan
ctrlaltdylan / dockerfile.yml
Last active November 13, 2018 05:23
Simple Laravel Container
version: '2'
services:
laravel:
image: php:latest
expose:
- '80'
- '443'
volumes:
- .:/home
@ctrlaltdylan
ctrlaltdylan / state_area_codes.json
Created December 6, 2018 16:04
Phone area codes belonging to each US State
{
"AL": [205, 251, 256, 334, 938],
"AK": 907,
"AZ": [480, 520, 602, 623, 928],
"AR": [479, 501, 870],
"CA": [209, 213, 310, 323, 408, 415, 424, 442, 510, 530, 559, 562, 619, 626, 628, 650, 657, 661, 669, 707, 714, 747, 760, 805, 818, 831, 858, 909, 916, 925, 949, 951],
"CO": [303, 719, 720, 970],
"CT": [203, 475, 860, 959],
"DE": 302,
"FL": [239, 305, 321, 352, 386, 407, 561, 727, 754, 772, 786, 813, 850, 863, 904, 941, 954],
@ctrlaltdylan
ctrlaltdylan / area_code_states.json
Created December 6, 2018 16:24
Each U.S. state area code and their corresponding state
{
"512": "TX",
"513": "OH",
"515": "IA",
"516": "NY",
"517": "MI",
"518": "NY",
"520": "AZ",
"530": "CA",
"531": "NE",
@ctrlaltdylan
ctrlaltdylan / 01_sidekiq_upstart.config
Created December 13, 2019 16:14
EBextension for starting Sidekiq Process on Elasticbeanstalk
files:
"/opt/elasticbeanstalk/support/conf/sidekiq.conf":
mode: "000755"
content: |
description "Elastic Beanstalk Sidekiq Upstart Manager"
start on runlevel [2345]
stop on runlevel [06]
# explained above
respawn
@ctrlaltdylan
ctrlaltdylan / Dockerfile
Created February 24, 2020 15:37
Angular Docker example
FROM node
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json
RUN npm i
RUN npm i -g @angular/cli --unsafe
@ctrlaltdylan
ctrlaltdylan / app.js
Created April 7, 2020 17:22
Mongo DB Connection
// require('koa') or require('express') whatever fits your fancy
const { Connection } = require('./db');
Connection.connectToMongo().then(() => {
// initialize your app and register routes
router.get('whatever', async(ctx) => {
const result = await Connection.db.collectionName.find({ id: ctx.params.id });
ctx.res.body = result;