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
# /app/models/concerns/has_many_attached.rb | |
module HasManyAttached | |
extend ActiveSupport::Concern | |
class_methods do | |
def has_many_attached(name, dependent: :purge_later, service: nil, strict_loading: false, **options) | |
super(name, dependent: :purge_later, service: nil, strict_loading: false) | |
if options[:file_types].any? | |
validate "validate_#{name}_file_types".to_sym |
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
#!/bin/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
{ | |
"name": "UW_WP_Skeleton", | |
"version": "0.0.1", | |
"private": true, | |
"dependencies": { | |
"uw-ui-toolkit": "git://github.com/UWMadisonUcomm/uw-ui-toolkit.git#bowerignore" | |
}, | |
"ignore": [ | |
"**/.*", | |
"node_modules", |
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
{ | |
"name" : "uwmadison-umark/wordpress-skeleton", | |
"description" : "Skeleton WordPress Stack via Composer", | |
"authors" : [ | |
{ | |
"name" : "Nick Weaver", | |
"email" : "[email protected]", | |
"homepage": "http://umark.wisc.edu" | |
} | |
], |
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
# special handling for cap | |
function run_bundler_cap_cmd () { | |
if [ -e ./Gemfile ]; then | |
echo "bundle exec $@" | |
bundle exec $@ | |
else | |
cmd=$@ | |
echo ${cmd/cap /cap _2.15.5_ } | |
${cmd/cap /cap _2.15.5_ } | |
fi |