Skip to content

Instantly share code, notes, and snippets.

module Requests
module JsonHelpers
def json
JSON.parse(response.body)
end
end
end
@MrCoffey
MrCoffey / webpack.config.js
Last active August 7, 2016 04:21
My base webpack configuration
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');
module.exports = {
context: path.join(__dirname, "client"),
devtool: debug ? "inline-sourcemap" : null,
entry: [
"./js/app.js",
'webpack/hot/dev-server',
@MrCoffey
MrCoffey / Preferences.sublime-settings
Created August 24, 2016 22:40
My personal sublime text configuration
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": true,
"animation_enabled": true,
"atomic_save": true,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment, meta.tag - punctuation.definition.tag.begin",

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u
  1. Lower Case : M-l
@MrCoffey
MrCoffey / private.xml
Created November 11, 2016 03:34
Karabiner configuration for Microsoft Sculpt Key Remapping for Mac OS
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>Microsoft</vendorname>
<vendorid>0x045e</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>Sculpt</productname>
@MrCoffey
MrCoffey / appspec.yml
Last active November 21, 2016 14:54
Basic AWS CodePloy Policies configuration
# This is an appspec.yml template file for use with AWS CodeDeploy.
# The lines in this template starting with the hashtag symbol are
# instructional comments and can be safely left in the file or
# ignored.
# For help completing this file, see the "AppSpec File Reference" in the
# "AWS CodeDeploy User Guide" at
# http://docs.aws.amazon.com/codedeploy/latest/userguide/app-spec-ref.html
# Don't touch version, that's Amazons stuff.
version: 0.0
# Specify "os: linux" if this revision targets Amazon Linux,
@MrCoffey
MrCoffey / Dockerrun.aws.json
Created November 25, 2016 16:48
Depltoyment example of a basic dockerrun for multicontainers on beanstalk
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "liftit-app",
"host": {
"sourcePath": "/app"
}
},
{
# Sets the Docker image that will be used as a base.
FROM trenpixster/elixir:1.3.0
# Compiles app
RUN mkdir /app
WORKDIR /app
ENV MIX_ENV prod
# Injects AWS env variables explained below
@MrCoffey
MrCoffey / new_relic.config
Created January 27, 2017 20:04
Newrelic configuration for elasticbeanstalk
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/01-get-env-name.py":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env python
# https://steelpangolin.wordpress.com/2015/01/30/how-to-find-the-name-of-an-elastic-beanstalk-environment-from-inside-one-of-its-instances/
import boto.utils
@MrCoffey
MrCoffey / export_host_env_vars.sh
Created July 23, 2017 22:48
Writes custom ENV variables into aws elastic beanstalk
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/02export_host_env_vars.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
echo Defaults:root \!requiretty >> /etc/sudoers
for envvar in `jq '.optionsettings | {"aws:elasticbeanstalk:application:environment"}[] | .[]' /opt/elasticbeanstalk/deploy/configuration/containerconfiguration`
do