Skip to content

Instantly share code, notes, and snippets.

View jasonswett's full-sized avatar

Jason Swett jasonswett

View GitHub Profile
@jasonswett
jasonswett / build-and-deploy.rb
Created April 18, 2026 19:06
SaturnCI build and deploy pipeline script
#!/usr/bin/env ruby
require "json"
require "net/http"
require "uri"
credentials = JSON.parse(File.read(File.expand_path("~/.saturnci/credentials.json")))
user_id = credentials["user_id"]
api_token = credentials["api_token"]
base_url = "https://app.saturnci.com/api/v1"
class Stylist < ActiveRecord::Base
include ActionView::Helpers::NumberHelper
scope :active, -> { where(active: true) }
scope :inactive, -> { where(active: false) }
scope :with_active_salon, -> { joins(:salon).merge(Salon.active) }
scope :non_receptionist, -> {
joins('LEFT JOIN user_role ON user_role.user_id = stylist.user_id')
.joins('LEFT JOIN role ON user_role.role_id = role.id')
.where('role.code != ? OR role.code IS NULL', 'RECEPTIONIST')
gem_group :development, :test do
gem 'pg'
gem 'pry'
gem 'devise'
gem 'rspec-rails'
gem 'factory_bot_rails'
gem 'capybara'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
require 'open-uri'
require 'pry'
class Document
DOT_PADDING = 3
def initialize(text)
@words = text.gsub(/-/, ' ').split
end
[
{
name: 'Hamburger',
price: 10
},
{
name: 'Cheeseburger',
price: 11
},
{
# Generated on 2014-11-05 using generator-angular 0.9.8
'use strict'
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
# use this if you want to recursively match all subfolders:
# 'test/spec/**/*.js'
module.exports = (grunt) ->
# Load grunt tasks automatically
# Generated on 2014-11-05 using generator-angular 0.9.8
'use strict'
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
# use this if you want to recursively match all subfolders:
# 'test/spec/**/*.js'
module.exports = (grunt) ->
# Load grunt tasks automatically
gulp.task('test', function() {
server.listen(3000);
return gulp.src('spec/test.js')
.pipe(jasmine())
.on('end', function () {
server.close();
exit();
});
});
gulp.task('start-server', function() {
return server.listen(3000);
});
gulp.task('jasmine', function() {
return gulp.src('spec/test.js')
.pipe(jasmine());
});
gulp.task('test', ['start-server', 'jasmine'], function() {
this.lunchHub = angular.module('lunchHub', []);
this.lunchHub.config([
'$routeProvider', function($routeProvider) {
return $routeProvider.when('/addresses', {
templateUrl: '../templates/addresses/index.html',
controller: 'AddressIndexCtrl'
}).when('/groups', {
templateUrl: '../templates/groups/index.html',