To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
# https://github.com/gzigzigzeo/carrierwave-meta | |
# Integrating CarrierWave with JCrop | |
# Let implement the behavior like at this demo: deepliquid.com/projects/Jcrop/demos.php?demo=thumbnail | |
# The uploader: | |
class CropUploader < SobakaUploader | |
include CarrierWave::Meta | |
# Crop source is a source image converted from original which could be bigger than source area (left image in the example). | |
version :crop_source do |
Tested on: Rails 3.1, Mongoid 2.0.1, pg 0.12.0 gem | |
Migrate from Mongo to PG | |
1. remove mongoid gem | |
2. add pg gem | |
3. in application.rb re-add ActiveRecord | |
4. for all models | |
- inherit from ActiveRecord::Base | |
- get rid of Mongoid:Document line | |
- make migrations and put fields there |
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
#!/bin/bash | |
REMOTE=play@SERVER_IP | |
REMOTE_APP=/home/play/PROJECT_NAME/ | |
sbt stage || exit 1; | |
rsync -va target/ $REMOTE:$REMOTE_APP/target; | |
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh"; | |
ssh $REMOTE "cd $REMOTE_APP; ./start.sh"; |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
import sbt._ | |
import Keys._ | |
import java.net._ | |
import java.io.File | |
import play.PlayRunHook | |
/* | |
Grunt runner should be in project directory to be picked up by sbt | |
*/ | |
object Grunt { |
#!/bin/bash | |
# | |
# ========================================================================= | |
# Copyright 2014 Rado Buransky, Dominion Marine Media | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
/* | |
This assumes that your bower_components folder is /assets. I renamed it in .bower.json for sanities sake. | |
I use baseUrl = '/js' as this is where all my custom javascript is and requirejs can't navigate | |
bower's folder structure anyway. | |
*/ | |
requirejs.config({ | |
paths: { |
#!/bin/bash | |
# From ScalaCourses.com Introduction to Play Framework with Scala course | |
# https://www.scalacourses.com/student/showLecture/158 | |
set -eo pipefail | |
function help { | |
echo "Download or update Typesafe Activator on Linux and Cygwin" | |
echo "Usage: $(basename $0) [options]" |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
didInsertElement: function() { | |
var $this = this.$(), | |
$actions = Ember.$('.actions', $this); | |
$this.hover(function() { | |
$actions.slideDown(); | |
}, function() { | |
$actions.slideUp(); |