Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Colgate nathancolgate

View GitHub Profile
View nginx-ingress-deploy.yaml
apiVersion: v1
kind: Namespace
metadata:
name: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/instance: ingress-nginx
---
@nathancolgate
nathancolgate / locations.js.coffee
Created Mar 6, 2012
CoffeeScript and HAML Pagination in Backbone.js
View locations.js.coffee
class IamConnect.Collections.Locations extends Backbone.Collection
url: '/api/locations'
model: IamConnect.Models.Location
_.extend IamConnect.Collections.Locations.prototype, IamConnect.Mixins.PaginationCollectionMethods.prototype
@nathancolgate
nathancolgate / Gemfile
Last active Nov 30, 2019
How I built a rails interface on top of the amazing IceCube ruby gem. Video of final product: http://youtu.be/F6t-USuWPag
View Gemfile
# Add these two gems
gem 'ice_cube', '0.9.3'
gem 'squeel', '1.0.16'
@nathancolgate
nathancolgate / ssl_puma.sh
Last active Apr 23, 2019 — forked from tadast/ssl_puma.sh
localhost SSL with puma
View ssl_puma.sh
# 1) Create your private key
$ cd ~/.ssh
$ openssl genrsa -des3 -passout pass:x -out lvh.me.pass.key 2048
# 2) Generate RSA key
$ openssl rsa -passin pass:x -in lvh.me.pass.key -out lvh.me.key
# 3) Get rid of private key
$ rm lvh.me.pass.key
View gist:34e6bd699f82618277e7e718530e99bd
webpacker_1 | ℹ 「wdm」: Failed to compile.
webpacker_1 | ✖ 「wdm」: Hash: 3a4e636409bd11d802a3
webpacker_1 | Version: webpack 4.29.6
webpacker_1 | Time: 2096ms
webpacker_1 | Built at: 04/12/2019 11:36:00 AM
webpacker_1 | Asset Size Chunks Chunk Names
webpacker_1 | js/application-ccae482cc60dff2d1d2f.js 781 KiB application [emitted] application
webpacker_1 | js/application-ccae482cc60dff2d1d2f.js.map 943 KiB application [emitted] application
webpacker_1 | manifest.json 364 bytes [emitted]
webpacker_1 |
@nathancolgate
nathancolgate / omni_parser.rb
Created Mar 22, 2019
A ruby script for parsing the OmniClass excel file.
View omni_parser.rb
require 'roo'
require 'pp'
xlsx = Roo::Excelx.new('./omni.xlsx')
# sheet = xlsx.default_sheet
ones = []
twos = []
threes = []
fours = []
@nathancolgate
nathancolgate / rails_server_setup.sh
Created Mar 11, 2019
How we setup servers from 2014 - 2016
View rails_server_setup.sh
# Digital Ocean / Rails 4.1.6 / Ruby 2.1.3 / nginx 1.4.6 / Ubuntu 14.04x64 / Capistrano 3.2.1
# https://gorails.com/deploy/ubuntu/14.04
# https://coderwall.com/p/yz8cha/deploying-rails-app-using-nginx-unicorn-postgres-and-capistrano-to-digital-ocean
# http://www.cubicleapps.com/articles/ubuntu-rails-ready-with-nginx-unicorn
# 1) SETUP DEPLOY USER AND GET ROOT ACCESS OUT OF THE WAY
you@local:~$ ssh root@IPADDRESS
root@remote:~$ adduser USERNAME
root@remote:~$ visudo
# # User privilege specification
@nathancolgate
nathancolgate / mime_types.rb
Last active Nov 18, 2018 — forked from ream88/excel_template_handler.rb
Example demonstrating the use of writeexcel gem in rails 3.2
View mime_types.rb
# config/initializers/mime_types.rb
Mime::Type.register "application/vnd.ms-excel", :xls
@nathancolgate
nathancolgate / rackspace_account_meta_temp_url_key.sh
Last active Sep 26, 2018
How to Set your Rackspace Temp URL Key (X-Account-Meta-Temp-Url-Key) from the command line
View rackspace_account_meta_temp_url_key.sh
# General Reading: https://developer.rackspace.com/docs/cloud-files/v1/developer-guide/#document-public-access-to-your-cloud-files-account/tempurl
$ curl -v -H "X-Auth-User: <your_rackspace_username>" -H "X-Auth-Key: <your_rackspace_api_key>" https://auth.api.rackspacecloud.com/v1.0
* About to connect() to auth.api.rackspacecloud.com port 443 (#0)
* Trying 67.192.1.11... connected
* Connected to auth.api.rackspacecloud.com (67.192.1.11) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
You can’t perform that action at this time.