Skip to content

Commit

Permalink
final release
Browse files Browse the repository at this point in the history
  • Loading branch information
thedjinn committed Jan 14, 2015
0 parents commit 70973a5
Show file tree
Hide file tree
Showing 346 changed files with 302,103 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.sass-cache

# cucumber
webrat.log

# autogenerated stuff
site/js/jquery.ui.dial.js
site/css/style.css
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "vendor/turbosass"]
path = vendor/turbosass
url = [email protected]:thedjinn/turbosass.git
[submodule "vendor/jquery-ui-dial"]
path = vendor/jquery-ui-dial
url = git://github.com/thedjinn/jquery-ui-dial.git
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions Capfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
load 'deploy' if respond_to?(:namespace)

set :ssh_options, { :forward_agent => true }

set :application, "js303"
set :user, "deploy"
set :use_sudo, false
set :stage, :production

set :scm, :git
set :scm_verbose, true
set :git_enable_submodules, 1
set :repository, "ssh://[email protected]:22223/home/djinn/git/js303"
set :branch, "master"
set :deploy_via, :remote_cache
set :deploy_to, "/home/#{user}/apps/#{application}"

set :vps, "vps1.koffietijd.net"
role :app, vps
role :web, vps
role :db, vps, :primary => true

set :runner, user
set :admin_runner, user

set :current_path { fetch(:deploy_to) }
set(:latest_release) { fetch(:current_path) }
set(:release_path) { fetch(:current_path) }
set(:current_release) { fetch(:current_path) }

set(:current_revision) { capture("cd #{current_path}; git rev-parse --short HEAD").strip }
set(:latest_revision) { capture("cd #{current_path}; git rev-parse --short HEAD").strip }
set(:previous_revision) { capture("cd #{current_path}; git rev-parse --short HEAD@{1}").strip }

namespace :deploy do
task :default do
update
restart
end

task :setup, :except => { :no_release => true } do
dirs = [deploy_to, shared_path]
dirs += shared_children.map { |d| File.join(shared_path, d) }
run "#{try_sudo} mkdir -p #{dirs.join(' ')} && #{try_sudo} chmod g+w #{dirs.join(' ')}"
run "git clone #{repository} #{current_path}"
end

task :update do
transaction do
update_code
end
end

desc "Update the deployed code."
task :update_code, :except => { :no_release => true } do
run "cd #{current_path}; git fetch origin; git reset --hard #{branch}"
#run "cd #{current_path}; rm public/stylesheets/*.css; rm -fr tmp/sass-cache"
finalize_update
end

desc "Update the database (overwritten to avoid symlink)"
task :migrations do
update_code
#migrate
restart
end

namespace :rollback do
desc "Moves the repo back to the previous version of HEAD"
task :repo, :except => { :no_release => true } do
set :branch, "HEAD@{1}"
deploy.default
end

desc "Rewrite reflog so HEAD@{1} will continue to point to at the next previous release."
task :cleanup, :except => { :no_release => true } do
run "cd #{current_path}; git reflog delete --rewrite HEAD@{1}; git reflog delete --rewrite HEAD@{1}"
end

desc "Rolls back to the previously deployed version."
task :default do
rollback.repo
rollback.cleanup
end
end

[:start, :stop, :migrate].each do |t|
task t do ; end
end

task :restart, :roles => :app, :except => { :no_release => true } do
# Restart Passenger
run "#{try_sudo} touch #{File.join(current_path, 'tmp', 'restart.txt')}"
end
end
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source "http://rubygems.org"

gem "sinatra"
gem "sinatra-asset-pipeline"
gem "thin"
gem "slim"
gem "bower"
gem "pry"
67 changes: 67 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
GEM
remote: http://rubygems.org/
specs:
bower (0.0.2)
coderay (1.1.0)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.8.0)
daemons (1.1.9)
eventmachine (1.0.4)
execjs (2.2.2)
hike (1.2.3)
method_source (0.8.2)
multi_json (1.10.1)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.0)
rack-protection (1.5.3)
rack
rake (10.4.2)
sass (3.4.9)
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
sinatra-asset-pipeline (0.6.0)
coffee-script (~> 2.3)
rake (~> 10.0)
sass (~> 3.1)
sinatra (~> 1.4)
sprockets (~> 2.12)
sprockets-helpers (~> 1.1)
sprockets-sass (~> 1.2)
slim (3.0.1)
temple (~> 0.7.3)
tilt (>= 1.3.3, < 2.1)
slop (3.6.0)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-helpers (1.1.0)
sprockets (~> 2.0)
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
temple (0.7.5)
thin (1.6.3)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0)
rack (~> 1.0)
tilt (1.4.1)

PLATFORMS
ruby

DEPENDENCIES
bower
pry
sinatra
sinatra-asset-pipeline
slim
thin
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# JS303 - A TB-303 clone in JavaScript

## What's this?

You are looking at the source code for JS303, a fully functional TB-303 clone
written in JavaScript using the Web Audio API. It was written for the second
GrunnJS meetup which was held in November 2014.

The accompanying presentation for this project can be found at:

https://www.youtube.com/watch?v=YyVsKlKoNbA#t=2938

## How to use it?

First, make sure you have a recent Ruby installed and also Node.js and
CoffeeScript.

Then, clone the repository, run `bundle install`, and then `thin start`. Now
go to `localhost:3000` and rock it!

## License

First of all, if you use this software and make a hit song, buy me some
coffee!

Copyright (C) 2014 Emil Loer

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
12 changes: 12 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
ROOT = File.dirname(__FILE__)

task :default do
chdir ROOT
sh "sass --scss src/style.scss site/css/style.css"
cp "vendor/jquery-ui-dial/jquery.ui.dial.js", "site/js/jquery.ui.dial.js"
end

task :sass do
chdir ROOT
sh "sass --scss --watch src/style.scss:site/css/style.css"
end
14 changes: 14 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Bundler.require

# Enable asset pipeline
require 'sinatra/asset_pipeline'
register Sinatra::AssetPipeline

# Add support for bower components
configure do
settings.sprockets.append_path "./bower_components"
end

get "/" do
slim :index
end
Loading

0 comments on commit 70973a5

Please sign in to comment.