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
module EngineWithMigrations | |
class Engine < ::Rails::Engine | |
isolate_namespace EngineWithMigrations | |
initializer :append_migrations do |app| | |
unless app.root.to_s.match root.to_s | |
app.config.paths['db/migrate'] += config.paths['db/migrate'].expanded | |
end | |
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
module ReadOnly | |
def readonly? | |
true | |
end | |
def delete | |
raise ReadOnlyRecord | |
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
# x264 | |
git clone --depth 1 git://git.videolan.org/x264 | |
cd x264 | |
./configure --enable-static --enable-shared --disable-asm --prefix=/app/vendor/x264 | |
make | |
make install | |
# lame | |
curl -O "http://softlayer-dal.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz" | |
tar -xvf lame-3.99.5.tar.gz |
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
diff --git a/.buildpacks b/.buildpacks | |
new file mode 100644 | |
index 0000000..5eef61a | |
--- /dev/null | |
+++ b/.buildpacks | |
@@ -0,0 +1,2 @@ | |
+https://github.com/heroku/heroku-buildpack-ruby.git | |
+https://github.com/heroku/heroku-buildpack-php.git | |
diff --git a/.travis.yml b/.travis.yml | |
index e74af49..deb7417 100644 |
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
require 'ropencv' | |
include OpenCV | |
vect = std::Vector.new(cv::Mat) | |
vect << cv::imread(File.join('data','1-1.JPG')) | |
vect << cv::imread(File.join('data','1-2.JPG')) | |
vect << cv::imread(File.join('data','1-3.JPG')) | |
result_image = cv::Mat.new |
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
<div class="card"> | |
<div class="container"> | |
<div class="front"> | |
<img src="http://placehold.it/400x600" /> | |
</div> | |
<div class="back"> | |
<h5>This is a card.</h5> | |
<p>This card shows some content on the front and some on the back, and can be flipped by hovering on a desktop, or by swiping across on a touch device.</p> | |
<p>The back of the card is intentionally long, so that we can show both an example where the card is constrained to a square and where it is as long as the content on either side requires.</p> |
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
require 'git' | |
g = Git.open('.') | |
commits = g.log.reject do |commit| | |
commit.message.start_with?('Merge') | |
end | |
words = 0 | |
commits.each { |commit| words += commit.message.split(' ').count } |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
text { | |
font: 10px sans-serif; | |
} | |
</style> | |
<body> |
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
$(document).on('pjax:popstate ', function(event) { | |
if(event.direction == "back") { | |
console.log('executes before page-change'); | |
} | |
}); |
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 BaseModel extends \lithium\data\Model { | |
public static function create(array $data = array(), array $options = array()) { | |
$defaults = array('defaults' => true, 'class' => 'entity'); | |
$options += $defaults; | |
$model = get_called_class(); | |
if (isset($data['_type']) && $data['_type']) { | |
list($namespace, $name) = preg_split("/\\\[^\\\]*$/", $model); | |
$model = $namespace . '\\' . Inflector::humanize(Inflector::pluralize($data['_type'])); |