http://www.howtogeek.com/197947/how-to-install-python-on-windows/
python transform_csv.py
# this sucker takes care of validating datetime fields before rails gets there and | |
# messes everything up. it should preserve the local time zone from the user input, | |
# and check for nil. takes date strings of the format m/d/yyyy m:h (am/pm) | |
# this goes in the model | |
validates_with DateTimeValidator, :fields => [:add_date] | |
# this goes in some place like lib/date_time_validator.rb | |
class DateTimeValidator < ActiveModel::Validator | |
DATETIME_FORMAT = "%m/%d/%Y %I:%M %P" |
# Example Dockerfile | |
FROM hello-world |
class Api::UploadsController < ApiController | |
def create | |
@upload = Upload.new(upload_params) | |
ensure | |
clean_tempfile | |
end | |
private |
# (v.respond_to?(:empty?) ? v.empty? : !v) is basically rails' .blank? in plain ruby | |
class Hash | |
def delete_blank | |
delete_if do |k, v| | |
(v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && v.delete_blank.empty? | |
end | |
end | |
end |
-- Collision-resistant ids optimized for horizontal scaling and performance, for PL/PgSQL. | |
-- Based on https://github.com/ericelliott/cuid | |
-- Version 1.0.0 | |
-- Usage: SELECT cuid(); | |
-- BEGIN CONFIG --- | |
-- Put a unique host ID (int) here per server instance. | |
-- Once set, this value should not be changed. |
"----------------------------------------------------------------------------- | |
" General Stuff | |
"----------------------------------------------------------------------------- | |
set nohls | |
set incsearch | |
" set the search scan so that it ignores case when the search is all lower | |
" case but recognizes uppercase if it's specified | |
set ignorecase |
http://www.howtogeek.com/197947/how-to-install-python-on-windows/
python transform_csv.py
this.editor = new wysihtml5.Editor("textarea"); | |
this.editor.observe("load", function () { | |
var $iframe = $(this.composer.iframe); | |
var $body = $(this.composer.element); | |
$body | |
.css({ | |
'min-height': 0, | |
'line-height': '20px', | |
'overflow': 'hidden', |
blockquote { | |
background: #f7f7f7; | |
font-family: Georgia; | |
padding: 14px 14px 12px 12px !important; | |
border: 1px solid #e7e7e7; | |
margin: 1em 3em; | |
text-align: right; | |
font-size: 10pt; | |
-webkit-border-radius: 5px; |