This file contains 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
if Rails.env.development? | |
CarrierWave.configure do |config| | |
config.storage = :file | |
end | |
elsif Rails.env.test? | |
CarrierWave.configure do |config| | |
config.storage = :file | |
config.enable_processing = false | |
end | |
else # production |
This file contains 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
// Generated on 2013-08-13 using generator-angular 0.3.1 | |
'use strict'; | |
var LIVERELOAD_PORT = 35729; | |
var lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }); | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest; | |
// # Globbing |
This file contains 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
(function(){ | |
var app = angular.module('myApp.api', ['ngResource']); | |
app.factory("Clinic", ['$resource', function($resource) { | |
var resource = $resource("http://domain.com/api/v1/clinics/:id/:action/", | |
{ | |
id: "@id", | |
action: "@action" | |
}, | |
{ |
This file contains 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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
This file contains 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
class Client < ActiveRecord::Base | |
scope :search, ->(term) { | |
clients_table = self.arel_table | |
column = clients_table[:name] | |
where(column.matches("%#{term}%")) | |
} | |
end |
This file contains 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
# in order to complete Devise initial requirements: | |
# app/views/layout/application.html.erb | |
<% flash.each do |key, value| %> | |
<div class='flash' id='<%= key %>'> | |
<%= value %> | |
</div> | |
<% end %> |
This file contains 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
require 'rubygems' | |
require 'rqr' | |
string = "http://google.com" | |
mecard = "MECARD:N:Android OS;EMAIL:android@gmail.com;URL:http://google.com;;" | |
RQR::QRCode.create() do |qr| | |
qr.save(string, "google.jpg") | |
end |
This file contains 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
require 'sinatra' | |
helpers do | |
def partial(page) | |
erb page, :layout => false | |
end | |
end | |
get '/' do | |
@page_title = 'Mi pagina web' |
This file contains 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
=== IMPORT YOUR EXISTING SITES TO AEGIR IN 8 EASY STEPS | |
1. Upload or rsync full drupal root of your site to static/custom/name | |
2. Chmod everything with command: | |
$ chmod -R 775 static/custom/name | |
and files only with: | |
$ chmod -R 777 static/custom/name/sites/default/files/* |
This file contains 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
# primero colocarnos en el folder donde queremos tener nuestros dotfiles, en el ejemplo, | |
# directamente en el directorio de usuario | |
$ cd | |
# clonar repositorio que ya tienes | |
$ git clone git://github.com/badbit/dotvim.git | |
# esto creara el directorio dotvim en el directorio en que estábamos | |
$ ls -l | |
drwx------+ 65 aantillon staff 2210 Jan 30 02:53 dotvim |
OlderNewer