Skip to content

Instantly share code, notes, and snippets.

@cooljl31
cooljl31 / new_ruby_project_procedure.markdown
Created July 4, 2017 11:07
A walkthrough for creating a new Ruby project

New Ruby software project procedure

First, ensure the following tools are available on the local system and reasonably up to date:

  • Git
  • Git-flow
  • RVM
  • Bash
  • SSH
@cooljl31
cooljl31 / modal.slim.html
Created June 27, 2017 12:32 — forked from StanBoyet/modal.slim.html
Boostrap Modal in Slim
/ Simple Slim translation of Bootstrap modal
.modal.fade.bs-example-modal-lg id="myModal" tabindex='-1' role='dialog' aria-labelledby="Modal Title" aria-hidden='true'
.modal-dialog.modal-lg
.modal-content
.modal-header
button.close type='button' data-dismiss='modal'
span aria-hidden='true' ×
span.sr-only Close
h4.modal-title = "Modal Title"
@cooljl31
cooljl31 / app.js
Created June 13, 2017 19:46 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
/**
* express static server for react build/dist test!
*/
// simple express server for HTML pages!
// ES6 style
const express = require('express');
const fs = require('fs');
const hostname = '127.0.0.1';

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@cooljl31
cooljl31 / README.md
Created June 2, 2017 13:58 — forked from petehamilton/README.md
Circle CI Build Status widget for Dashing (Multiple Builds)

Description

Dashing widget to show the status of builds from CircleCI. Also shows the avatar of the person who is running/breaking/passing the current build.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

@cooljl31
cooljl31 / README.md
Created June 2, 2017 13:56 — forked from petehamilton/README.md
Circle CI Build Status widget for Dashing (Single Builds)

Description

Dashing widget to show the build status of a CircleCI project.

Usage

  • Get a Circle API Token from your Account Dashboard and set it in your environment as CIRCLE_CI_AUTH_TOKEN
  • Add the httparty to your Gemfile and run bundle install

Then:

@cooljl31
cooljl31 / deploy.rb
Created May 22, 2017 13:36 — forked from mm53bar/deploy.rb
My capistrano deployment
require File.join(File.dirname(__FILE__), 'deploy/nginx')
require File.join(File.dirname(__FILE__), 'deploy/log')
default_run_options[:pty] = true
set :ssh_options, { :forward_agent => true }
set :application, "appname"
set :repository, "git@giturl"
set :scm, :git
@cooljl31
cooljl31 / nginx.conf.default
Created May 22, 2017 13:10 — forked from nishantmodak/nginx.conf.default
Default Nginx Conf
#user nobody;
#Defines which Linux system user will own and run the Nginx server
worker_processes 1;
#Referes to single threaded process. Generally set to be equal to the number of CPUs or cores.
#error_log logs/error.log; #error_log logs/error.log notice;
#Specifies the file where server logs.
@cooljl31
cooljl31 / heroku_style_baby.rb
Created May 19, 2017 06:32 — forked from gilesbowkett/heroku_style_baby.rb
Heroku-style dev on EC2 || Slicehost || whatev
require 'rubygems'
require 'sinatra'
require 'json'
class GitHubUpdater
def self.update?(json)
(JSON.parse(json)["ref"] == "refs/heads/master")
end