echo $(date +”%m_%d_%Y”)
Rewrite as
echo (date +”%m_%d_%Y”)
# Add this to your .bash_profile file. | |
# Assumes you are running a OSX, using the default Terminal.app, and have Homebrew (for its custom theme) installed. | |
# Inspiration from: https://gist.github.com/porras/5856906 | |
function colorssh() { | |
# Change the theme of Terminal.app | |
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"Homebrew\""; | |
# Run the `ssh` command | |
ssh $* |
#!/bin/bash | |
APP_NAME="your-app-name-goes-here" | |
APP_PATH=/home/deploy/${APP_NAME} | |
# Production environment | |
export RAILS_ENV="production" | |
# This loads RVM into a shell session. Uncomment if you're using RVM system wide. | |
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" |
#!/bin/sh | |
# To reinstall this script in the same or another git repo run: | |
# curl -sSL https://gist.githubusercontent.com/elliotthilaire/cef91754bb296d67e776/raw/pre-push > .git/hooks/pre-push; chmod +x .git/hooks/pre-push | |
# check that pronto is installed | |
hash pronto 2>/dev/null || { | |
echo >&2 "Pronto is not installed. Install with 'gem install pronto pronto-rubocop'"; | |
echo >&2 "Find other Pronto runners at https://github.com/mmozuras/pronto#runners"; | |
exit 0; |
#!/bin/sh | |
# To reinstall this script in the same or another git repo run: | |
# curl -sSL https://gist.github.com/elliotthilaire/5e56566b75781b8cd9d2/raw/pre-commit > .git/hooks/pre-commit; chmod +x .git/hooks/pre-commit | |
# check that pronto is installed first | |
hash pronto 2>/dev/null || { | |
echo >&2 "Pronto is not installed. Install with 'gem install pronto pronto-rubocop'"; | |
echo >&2 "Find other pronto runners at https://github.com/mmozuras/pronto#runners"; | |
exit 0; |
const EventEmitter = require('events') | |
const myEmitter = new EventEmitter() | |
function start () { | |
myEmitter.emit('ready') | |
myEmitter.emit('set') | |
myEmitter.emit('go') | |
} |
# http://guides.rubyonrails.org/asset_pipeline.html#controller-specific-assets | |
Dir[Rails.root.join('app/controllers/**/*_controller.rb')].each do |path| | |
controller_path = path.match(/controllers\/(.*)_controller.rb/)[1] | |
Rails.application.config.assets.precompile += ["#{controller_path}.js", "#{controller_path}.scss"] | |
end |
<%= form_tag project_assets_path(project), multipart: true, class: 'upload-form' do %> | |
<%= file_field_tag 'file' %> | |
<%= submit_tag 'Upload' %> | |
<% end %> |
COPY package.json /usr/src/app/ | |
COPY yarn.lock /usr/src/app/ | |
# TODO: replace custom repository when yarn is no longer in edge/community | |
RUN apk add yarn --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ && \ | |
yarn install && \ | |
apk del yarn |
# http://sequel.jeremyevans.net/rdoc/classes/Sequel/SQL/Builders.html#method-i-case | |
# http://sequel.jeremyevans.net/rdoc/classes/Sequel/Dataset.html#method-i-order | |
# http://www.justinweiss.com/articles/how-to-select-database-records-in-an-arbitrary-order/ | |
# Given an array of ids. How can we retrieve the records in that order. | |
# Using the Sequel gem. | |
# SELECT * FROM items WHERE id IN (2, 3, 1, 4) ORDER BY | |
# CASE id | |
# WHEN 2 THEN 0 |