Skip to content

Instantly share code, notes, and snippets.

View marklocklear's full-sized avatar

J. Mark Locklear marklocklear

View GitHub Profile
@marklocklear
marklocklear / join_practice.sql
Last active January 27, 2025 14:22
Employees, dept and projects database
-- Create employees table
CREATE TABLE employees (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL,
department_id INT,
salary DECIMAL(10, 2)
);
-- Create departments table
CREATE TABLE departments (
@marklocklear
marklocklear / ruby_rag.rb
Last active January 28, 2025 14:57
Ruby Rag
# Landon Gray https://x.com/thedayisntgray/status/1880245705450930317
require 'httparty'
require 'numo/narray'
require 'openai'
require 'faiss'
require 'matrix'
require 'io/console'
require 'dotenv'
#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