Skip to content

Instantly share code, notes, and snippets.

View knoxjeffrey's full-sized avatar

Jeff Knox knoxjeffrey

View GitHub Profile
@knoxjeffrey
knoxjeffrey / config_issue
Created December 3, 2014 16:23
.git/config problem when opening
Last login: Wed Dec 3 00:10:05 on ttys000
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config ; exit;
Jeffreys-MacBook-Pro:~ knoxjeffrey$ /Users/knoxjeffrey/Ruby/programming_introduction/.git/config ; exit;
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 1: [core]: command not found
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 2: repositoryformatversion: command not found
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 3: filemode: command not found
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 4: bare: command not found
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 5: logallrefupdates: command not found
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 6: ignorecase: command not found
/Users/knoxjeffrey/Ruby/programming_introduction/.git/config: line 7: precomposeunicode: command not found
@knoxjeffrey
knoxjeffrey / gist:e2832abd231d51aac8db
Created December 11, 2014 12:43
module while loop
module Text
def self.print_string(text)
puts "\n*** #{text} ***"
end
def self.chomp_it
gets.chomp
end
end
class NotesController < ApplicationController
def index
load_notes
end
def show
load_note
end
def new
@knoxjeffrey
knoxjeffrey / gist:084acb8b0132225e5eed
Created July 11, 2015 22:40
Archive for jekyll theme
---
layout: default
---
<section class="posts postindex wrapper">
{% for post in site.posts %}
{% capture month %}{{ post.date | date: '%m%Y' }}{% endcapture %}
{% capture nmonth %}{{ post.next.date | date: '%m%Y' }}{% endcapture %}
{% if month != nmonth %}
{% if forloop.index != 1 %}</ul>{% endif %}
@knoxjeffrey
knoxjeffrey / aws-postgis.txt
Last active April 17, 2019 08:43
Script to setup a Elastic Beanstalk AMI with geospatial libraries and postGIS
#!/bin/bash
#
# Script to setup a Elastic Beanstalk AMI with geospatial libraries and postGIS
#
# sh aws_ami_prep.sh > aws_ami_prep.log 2>&1 &
# See orig here: https://gist.github.com/whyvez/8d19096712ea44ba66b0
# Go to ec2-user home directory
cd /home/ec2-user
#!/bin/bash
#
# Go to ec2-user home directory
cd /home/ec2-user
# Update libpng first
curl -L http://sourceforge.net/projects/libpng/files/libpng15/1.5.27/libpng-1.5.27.tar.xz/download -o libpng.tar.xz
tar -Jxf libpng.tar.xz
cd libpng-1.5.27/
@knoxjeffrey
knoxjeffrey / db_pull.rake
Created October 23, 2018 23:09
Pull specified db to development
# rake db:pull[<environment to pull from>,<your local db username>]
# eg. rake db:pull[staging,postgres]
namespace :db do
desc 'Pull specified db to development'
task :pull, :environment, :dev_db_user do |_t, args|
environment = args[:environment].to_sym
dev_db_user = args[:dev_db_user]
dev = Rails.application.config.database_configuration['development']
dumpfile = "#{Rails.root}/tmp/latest.dump"
@knoxjeffrey
knoxjeffrey / db_staging_to_production.rake
Created October 23, 2018 23:18
Pull specified db to development, move to production
# rake db:staging_to_production
# eg. rake db:staging_to_production
namespace :db do
desc 'Pull specified db to development, move to production'
task :staging_to_production do
dumpfile = "#{Rails.root}/tmp/latest.dump"
ssh = Rails.application.credentials[:staging][:ssh]
ssh_port = Rails.application.credentials[:staging][:ssh_port]
@knoxjeffrey
knoxjeffrey / media_pull.rake
Created October 23, 2018 23:19
Pull media from specified environment to development
# rake media:pull[<environment to pull from>]
# eg. rake media:pull[staging]
namespace :media do
desc 'Pull media from specified environment to development'
task :pull, :environment do |_t, args|
environment = args[:environment].to_sym
ssh = Rails.application.credentials[environment][:ssh]
ssh_port = Rails.application.credentials[environment][:ssh_port]
media_remote = Rails.application.credentials[environment.to_sym][:media_remote]
@knoxjeffrey
knoxjeffrey / media_staging_to_production.rake
Created October 23, 2018 23:20
Pull media from specified staging to production
# rake media:staging_to_production
# eg. rake media:staging_to_production
namespace :media do
desc 'Pull media from specified staging to production'
task :staging_to_production do
ssh_staging = Rails.application.credentials[:staging][:ssh]
ssh_staging_port = Rails.application.credentials[:staging][:ssh_port]
media_staging_remote = Rails.application.credentials[:staging][:media_remote]
media_production_remote = Rails.application.credentials[:production][:media_remote]