Skip to content

Instantly share code, notes, and snippets.

View PelagicDev's full-sized avatar

Jordan Godwin PelagicDev

  • CompanyCam
  • Wilmington, NC
  • 23:34 (UTC -04:00)
  • X @PelagicDev
View GitHub Profile
@PelagicDev
PelagicDev / file_name.es6.jsx.erb
Created March 4, 2016 16:24
ERB image_tag in React JSX
class MyImage extends React.Component {
render () {
return (
<img src="<%= asset_url('path/to/image.png') %>" />
);
}
}
//
// Top Bar Variables
//
$include-html-classes: true;
$include-html-top-bar-classes: $include-html-classes;
// Background color for the top bar
$topbar-bg-color: $oil;
$topbar-bg: $topbar-bg-color;
@PelagicDev
PelagicDev / digital_ocean_setup.md
Created August 12, 2016 18:06 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions
@PelagicDev
PelagicDev / ubunut_16_04_server_setup.md
Last active June 25, 2017 03:01 — forked from jtadeulopes/server.md
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@PelagicDev
PelagicDev / puma_systemd_setup.md
Last active February 25, 2023 20:53
Ubuntu Rails & Puma Server setup
@PelagicDev
PelagicDev / puma.service
Created November 19, 2016 03:22 — forked from arteezy/puma.service
Manage Puma with systemd on Ubuntu 16.04 and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@PelagicDev
PelagicDev / controller.rb
Created December 12, 2016 20:36
Rails Form & Service Objects using PSQL `:daterange`
class TournamentsController < ApplicationController
# GET /tournaments/new
def new
@form = TournamentSubmissionForm.new
end
# POST /tournaments
def create
@form = TournamentSubmissionForm.from_params(params)
@PelagicDev
PelagicDev / interchange_helper.rb
Created December 29, 2016 21:20 — forked from flexbox/interchange_helper.rb
[ruby on rails] - Image helper for retina display with foundation interchange
module ApplicationHelper
def retina_image_tag(default_name, options={})
retina_name = default_name.gsub(%r{\.\w+$}, '@2x\0')
retina_image_tag(default_name, options.merge('data-interchange' => "[#{asset_path(retina_name)}, (retina)]"))
end
end
@PelagicDev
PelagicDev / .env
Created January 17, 2017 14:51 — forked from benphelps/.env
Cloud66 Basic Postgres
POSTGRES_USER=phelps
POSTGRES_PASS=phelps
POSTGRES_HOST=localhost
@PelagicDev
PelagicDev / .gitlab-ci.yml
Created January 17, 2017 15:21 — forked from benphelps/.gitlab-ci.yml
A test / deploy setup I use
image: benphelps/docker-ruby-phantomjs:latest
Testing:
services:
- postgres:latest
variables:
POSTGRES_DB: test
POSTGRES_HOST: postgres
POSTGRES_USER: testuser
POSTGRES_PASS: testuser
environment: test