Skip to content

Instantly share code, notes, and snippets.

View marklocklear's full-sized avatar

J. Mark Locklear marklocklear

View GitHub Profile
#include <iostream>
using namespace std;
int main() {
string light;
cout << "What is the traffic light color?" <<endl;
cin >> light;
if(light == "green"){
cout << "Go!" <<endl;
//J. Mark Locklear
//1March22
#include <iostream>
using namespace std;
int main() {
//cout statement
std::cout << "Hello Mark!\n";
//Miles Per Gallon App
//Mark Locklear
#include <iostream>
using namespace std;
int main() {
string make_model;
int miles;
int gallons;
<?php
$servername = "localhost";
$username = "admin";
$password = "password";
$dbname = "mydb";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
package blarg;
/**
*
* @author marklocklear
*/
public class Blarg {
/**
* @param args the command line arguments

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

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

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 December 19, 2017 16:38 — forked from orendon/rails_bare_metal_vps.md
Bare Metal Linux - Rails Capistrano - Nginx + Passenger tux

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 December 18, 2015 08:49
Summer of Rails
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">