- Place
deploy.sh
in{docpad folder}/bin/
- Create (or edit) a
.env
file in your docpad folder with the following values:
#!/bin/bash
DEPLOY_SOURCE_DIR="out/"
DEPLOY_DEST_DIR="~/public_html/"
DEPLOY_SERVER=deploy-server-name
-module(levenshtein). | |
-export([distance/2]). | |
store_result(Key, Value, Cache) -> | |
{Value, dict:store(Key, Value, Cache)}. | |
distance(String1, String2) -> | |
{List,_} = distance(String1, String2, dict:new()), | |
List. |
defmodule Levenshtein do | |
def first_letter_check(one_letter, two_letter) do | |
case one_letter == two_letter do | |
true -> 0 | |
false -> 1 | |
end | |
end | |
def distance(string_1, string_1), do: 0 | |
def distance(string, ''), do: :string.len(string) |
###! | |
* | |
* Back-Propagation Neural Networks | |
* | |
* References: | |
* http://arctrix.com/nas/python/bpnn.py | |
* | |
### | |
class BPNN |
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
# | |
# At CoverHound, we use conditional validations all over the form. However, there is no proper way to do | |
# this in Rails. Instead, we can provide an array of attributes (validated_fields attribute) | |
# and ensure they are the only ones to get validated. | |
# | |
module ConditionalValidations | |
attr_accessor :validated_fields | |
def field_is_required?(field) |
source "https://rubygems.org/" | |
gem "neo4j" | |
gem "pry" | |
gem "minitest" | |
gem "jbundler" | |
require 'benchmark/ips' | |
Benchmark.ips do |x| | |
RESULT = [1] | |
x.report('first') do |times| | |
i = 0 | |
while i < times | |
id = RESULT.first | |
i += 1 |
class Mustachio extends Backbone.View | |
templates: {} | |
render: -> | |
@templates[@templateName].call @, @renderContext() | |
lazyCompileFactory: (template_id, raw_template) -> | |
@templates[template_id] = (context) => | |
compiled_template = Handlebars.compile(raw_template) | |
@templates[this.id] = compiled_template |
class Collection | |
constructor: (items) -> | |
@all = if _.any(items, (item) => item instanceof @modelType) | |
items | |
else | |
(new @modelType(item) for item in items) | |
add: (item) -> | |
@all.push(item) |