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
// Adapted from the awesome zurb foundation | |
// https://github.com/zurb/foundation/blob/v5.2.0/scss/foundation/components/_block-grid.scss | |
// | |
// Block Grid Mixins | |
// | |
// We use this to control the maximum number of block grid elements per row | |
$block-grid-elements: 12 !default; |
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
# -*- coding: utf-8 -*- | |
$:.unshift("/Library/RubyMotion/lib") | |
require 'motion/project/template/ios' | |
require './lib/preprocessor' | |
begin | |
require 'bundler' | |
Bundler.require | |
rescue LoadError | |
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
def tableView(table_view, cellForRowAtIndexPath: index_path) | |
data_row = @data[index_path.row] | |
#cell = table_view.dequeueReusableCellWithIdentifier(ALERTS_CELL_ID) || begin | |
# rmq.create(AlertsCell, :alerts_cell, reuse_identifier: ALERTS_CELL_ID).get | |
#end | |
cell ||= AlertsCell.alloc.initWithStyle(UITableViewCellStyleSubtitle, reuseIdentifier:ALERTS_CELL_ID).autorelease | |
cell = rmq.build(cell, :alerts_cell).get |
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 'uri' | |
hostname = "(?:(?:[\\w\\-]+\\.)+[[:alpha:]]{2,})" | |
host = "(?:#{hostname}|#{URI::DEFAULT_PARSER.pattern[:IPV4ADDR]}|#{URI::DEFAULT_PARSER.pattern[:IPV6ADDR]})" | |
server = "//(?:#{URI::DEFAULT_PARSER.pattern[:USERINFO]}@)?#{host}(?::\\d*)?" | |
absolute_path = "(?:#{URI::DEFAULT_PARSER.pattern[:ABS_PATH]})?" | |
query = URI::DEFAULT_PARSER.pattern[:QUERY] | |
http_uri_regex = Regexp.new("\\A(?:http|https):(?:#{server}#{absolute_path})(?:\\?(?:#{query}))?\\z", Regexp::EXTENDED, 'N') |
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
post_data = {} | |
post_data[:name] = 'Title for my link' | |
post_data[:link] = 'http://path.to/my/link' | |
post_data[:caption] = 'A caption' | |
post_data[:description] = 'A description' | |
post_data[:picture] = 'http://path.to/myimage.jpg' | |
post_data[:actions] = { :name => 'My site name', :link => 'http://link.to/my/site'}.to_json | |
client.post("feed", nil, post_data) |
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 "rails_admin/application_controller" | |
require "rails_admin/abstract_history" | |
module RailsAdmin | |
# use declarative_authorization for rails_admin's authz | |
class ApplicationController < ::ApplicationController | |
filter_access_to :all | |
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
# Drop this file in config/initializers to run your Rails project on Ruby 1.9. | |
# This is three separate monkey patches -- see comments in code below for the source of each. | |
# None of them are original to me, I just put them in one file for easily dropping into my Rails projects. | |
# Also see original sources for pros and cons of each patch. Most notably, the MySQL patch just assumes | |
# that everything in your database is stored as UTF-8. This was true for me, and there's a good chance it's | |
# true for you too, in which case this is a quick, practical solution to get you up and running on Ruby 1.9. | |
# | |
# Andre Lewis 1/2010 | |
# encoding: utf-8 |
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
# Configure whenever | |
set :whenever_environment, rails_env | |
set :whenever_output, '/var/www/apps/alt12/current/log/crontab.log' | |
set :whenever_update_flags, "--update-crontab #{whenever_identifier} --set environment=#{whenever_environment}\\&output=#{whenever_output}" # notice the escaping \& passed to the shell |
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
# put in config/application.rb | |
config.to_prepare do | |
::PagesController.module_eval do | |
caches_page :show, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
caches_page :home, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
end | |
::Page.module_eval do | |
after_save :clear_static_caching! | |
after_destroy :clear_static_caching! |
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" | |
Dir.foreach("#{Rails.root}/app/models") do |model_name| | |
require_dependency model_name unless model_name == "." || model_name == ".." | |
end | |
end |
OlderNewer