This file contains hidden or 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
tasks> mix compile | |
Unchecked dependencies for environment dev: | |
* cowboy (package) | |
the dependency cowboy in mix.exs is overriding a child dependency: | |
> In mix.exs: | |
{:cowboy, "~> 1.0.0", [hex_app: :cowboy]} | |
> In deps/phoenix/mix.exs: | |
{:cowboy, "~> 0.10.0", [git: "git://github.com/extend/cowboy.git", optional: true]} |
This file contains hidden or 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
iex(10)> Process.alive? tile_pid | |
true | |
iex(11)> Process.register tile_pid, :foo | |
** (ArgumentError) argument error | |
:erlang.register(:foo, #PID<0.163.0>) | |
(elixir) lib/process.ex:333: Process.register/2 |
This file contains hidden or 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
require File.expand_path(File.dirname(__FILE__) + '/neo') | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used to calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points | |
# |
This file contains hidden or 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 Order < ActiveRecord::Base | |
has_many :line_items | |
before_save :update_total | |
def update_total | |
self.total = line_items.pluck(:price).inject(:+) | |
end | |
This file contains hidden or 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
require "java" | |
Dir["#{File.dirname(__FILE__)}/itext-5.3.5/\*.jar"].each { |jar| require jar } | |
import com.itextpdf.text.BaseColor | |
import com.itextpdf.text.Document | |
import com.itextpdf.text.Paragraph | |
import com.itextpdf.text.Element | |
import com.itextpdf.text.pdf.ColumnText | |
import com.itextpdf.text.pdf.PdfWriter | |
import com.itextpdf.text.pdf.PdfContentByte |
This file contains hidden or 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
Backbone.Base = function() { | |
this.initialize.apply(this, arguments); | |
}; | |
Backbone.Base.extend = Backbone.Model.extend; | |
_.extend(Backbone.Base.prototype, Backbone.Events, { | |
initialize: function() {} | |
}); |
This file contains hidden or 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
// This is a combination of two modified files from jQuery Mobile, | |
// jquery.mobile.vmouse.js and jquery.mobile.event.js | |
// They were modified to only provide the touch event shortcuts, and | |
// avoid the rest of the jQuery Mobile framework. | |
// The normal jQuery Mobile license applies. http://jquery.org/license | |
// | |
// This plugin is an experiment for abstracting away the touch and mouse | |
// events so that developers don't have to worry about which method of input | |
// the device their document is loaded on supports. | |
// |
This file contains hidden or 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
require "ejs" | |
class JstFilter < Rake::Pipeline::Filter | |
def initialize(output_filename=nil, &block) | |
block = proc { output_filename } | |
super(&block) | |
end | |
def generate_output(inputs, output) |
This file contains hidden or 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
group :development do | |
gem 'ejs' | |
gem 'rb-fsevent' # optional | |
gem 'listen' | |
end |
This file contains hidden or 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
function currentTimezoneOffset() { | |
var dstPeriod = { | |
2012: [new Date(2012, 2, 11), new Date(2012, 10, 4)], | |
2013: [new Date(2013, 2, 10), new Date(2013, 10, 3)], | |
2014: [new Date(2014, 2, 9), new Date(2014, 10, 2)], | |
2015: [new Date(2015, 2, 8), new Date(2015, 10, 1)], | |
2016: [new Date(2016, 2, 13), new Date(2016, 10, 6)], | |
2017: [new Date(2017, 2, 12), new Date(2017, 10, 5)], | |
2018: [new Date(2018, 2, 11), new Date(2018, 10, 4)], | |
2019: [new Date(2019, 2, 10), new Date(2019, 10, 3)], |
NewerOlder