This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TimeEntriesController < ApplicationController | |
before_action :set_project, :set_issue | |
def create | |
@time_entry = container.time_entries.build time_entry_params.merge(user: User.current) | |
if @time_entry.save | |
respond_to do |format| | |
format.html { redirect_back_or_default created_time_entry_url, notice: l(:notice_successful_create) } | |
format.api { render :show, status: :created, location: @time_entry } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/routes.rb | |
resources :documents do | |
scope module: 'documents' do | |
resources :versions do | |
post :restore, on: :member | |
end | |
resource :lock | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************************************* | |
* #### Twitter Post Fetcher v10.0 #### | |
* Coded by Jason Mayes 2013. A present to all the developers out there. | |
* www.jasonmayes.com | |
* Please keep this disclaimer with my code if you use it. Thanks. :-) | |
* Got feedback or questions, ask here: | |
* http://www.jasonmayes.com/projects/twitterApi/ | |
* Updates will be posted to this site. | |
*********************************************************************/ | |
var twitterFetcher = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Shorthand map over List-like | |
f <$ lx = map f lx -- <$> in Haskell | |
lx $> f = map f lx | |
infixr 2 <$ | |
infixr 2 $> | |
-- Shorthand sequential application | |
lf <$$ lx = zipWith (\f x -> f x) lf lx -- <*> in Haskell | |
lx $$> lf = zipWith (\f x -> f x) lf lx -- <**> in Haskell | |
infixr 1 <$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ticket < ActiveRecord::Base | |
belongs_to :grouper | |
belongs_to :user | |
validate :user_cant_be_blacklisted, on: :confirmation | |
validate :user_cant_double_book, on: :confirmation | |
validate :grouper_cant_be_full, on: :confirmation | |
validate :grouper_cant_have_occurred, on: :confirmation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MODEL | |
class Case < ActiveRecord::Base | |
include Eventable | |
has_many :tasks | |
concerning :Assignment do | |
def assign_to(new_owner:, details:) | |
transaction do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// libsass (v3.3.6) | |
// ---- | |
/* | |
* ****************************************************************************************** | |
* ****************************************************************************************** | |
* Obsolete Mixins and Functions | |
* ****************************************************************************************** | |
* ****************************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
minifycss = require('gulp-minify-css'), | |
livereload = require('gulp-livereload'); | |
gulp.task('styles', function(){ | |
return sass('scss/') | |
.on('error', function (err) { | |
console.error('Error!', err.message); |