Skip to content

Instantly share code, notes, and snippets.

Avatar

J. Mark Locklear marklocklear

View GitHub Profile
View sample java
package blarg;
/**
*
* @author marklocklear
*/
public class Blarg {
/**
* @param args the command line arguments
View Deploy a Rails App with Passenger and Nginx on Ubuntu 18.04.md

sudo apt-get update sudo apt-get upgrade

useradd deployer -G admin -m -s /bin/bash passwd deployer

#if digital ocean droplet may need to change PasswordAuthentication from no to yes in /etc/ssh/sshd_config before you can ssh-copy-id PasswordAuthentication yes sudo service sshd restart

View gist:4b79d7a0195b02db6decfa6256fde089
#model
class Coursera
include HTTParty
def self.for term
HTTParty.get("http://itunes.apple.com/search",
{query: {term: term}, format: :json})
end
end
View rails_bare_metal_ubuntu_16.md

Ubuntu 16 - Capistrano - Nginx + Passenger

1. Create Server

Add deployer user

groupadd admin
useradd deployer -G admin -m -s /bin/bash
passwd deployer
@marklocklear
marklocklear / rails_bare_metal_vps.md
Last active Dec 19, 2017 — forked from orendon/rails_bare_metal_vps.md
Bare Metal Linux - Rails Capistrano - Nginx + Passenger tux
View rails_bare_metal_vps.md

Digital Ocean Ubuntu 14.04 - Capistrano - Nginx + Passenger

1. Create droplet

Add deployer user

groupadd admin
useradd deployer -G admin -m -s /bin/bash
passwd deployer
@marklocklear
marklocklear / gist:5757086
Last active Dec 18, 2015
Summer of Rails
View gist:5757086
Week 4
>rails g migration add_completed_to_ideas completed:boolean
>
<div class="field">
<%= f.label :completed %><br />
<%= f.check_box :completed %>
</div>
>rails g migration add_range_to_ideas range:integer
<
<div class="field">
View gist:5665482
require 'brewery_db'
brewery_db = BreweryDB::Client.new do |config|
config.api_key = 'b7a3521dc50ce9c2e6c675dd896c276a'
end
=begin
abv = brewery_db.beers.all(abv: '5.5')
abv.each do |b|
puts b.name
View gist:5491006
#main.rb
require "./include.rb"
@board = Array.new
@board = {'ul' => 'ul', 'um' => 'um', 'ur' => 'ur',
'ml' => 'ml', 'mm' => 'mm', 'mr' => 'mr',
'll' => 'll', 'lm' => 'lm', 'lr' => 'lr'}
puts "Enter a move in the following sequence\n
View gist:5491002
#include.rb
def show_board
count = 0
@board.each { |key, value|
print "#{value}" + " | "
if count == 2 or count == 5 then print "\n______________\n" end
count += 1
}
print "\n"
end
View gist:4111359
A big thank you to anyone who has donated already - it is very truly appreciated.
My brother Nate is fighting stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (unpaid FMLA), no insurance coverage, and cannot afford treatment. Nate and his family need your help. Thank you.
Josh Goebel, Pastie creator
Donate now Read Nate's story Hide this message
Pastie Pastie << self Blog
You can’t perform that action at this time.