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
<style> | |
#mask_demo { | |
background: #d0d0d0; | |
width: 80%; | |
padding: 10px; | |
position: relative; | |
} | |
/* this may not be a better way to do it, but it is a different way. | |
it still used the svg for the background on browsers that don't |
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
<?php | |
add_action( 'pre_get_posts', 'prefix_reverse_post_order' ); | |
/** | |
* Reverse Post Order for Post Archives | |
* on the Genesis Framework | |
* | |
* @author FAT Media | |
* @link http://youneedfat.com/reverse-post-order-genesis-framework/ | |
* @param object $query 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
#!/usr/bin/env ruby | |
# Example script to deploy a Rails application via Git post-receive hook | |
# | |
# INSTALL | |
# | |
# $ curl http://gist.github.com/442106.txt -o post-receive | |
# $ mv post-receive path/to/to/your/repo.git/hooks/post-receive | |
# $ chmod +x post-receive |
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
module ApplicationHelper | |
# get the name of the current layout in views | |
# http://stackoverflow.com/a/9438314/2535178 | |
def current_layout | |
layout = controller.send(:_layout) | |
if layout.instance_of? String | |
layout | |
else | |
File.basename(layout.identifier).split('.').first | |
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
.particleJs | |
background-color transparent | |
width 35% | |
height 100% | |
display block | |
position absolute | |
top 0px | |
left 0px |
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
# Throw this in config/initializers and add | |
# @import variables.sass to the top of application.sass | |
# to have all variables in app_config.yml | |
# available as variables in your sass stylesheets | |
sass_variables = [] | |
app_variables = YAML.load_file("#{Rails.root}/config/app_config.yml") | |
app_variables.each do |key, value| | |
sass_vars << "!#{key} = #{value}" |
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
# /etc/nginx/sites-enabled/default | |
########################################## | |
########################################## | |
## General Server Setup ## | |
########################################## | |
########################################## |
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
# Model using the ghostscript processor | |
class Content < ActiveRecord::Base | |
has_attached_file :resource, | |
:styles => { :preview => ["725x1200>", :jpg], :thumb => ["100x140>", :jpg] }, | |
:processors => [:ghostscript, :thumbnail], | |
:convert_options => { :all => '-colorspace RGB -flatten -density 300 -quality 100' }, | |
:path => ":page_path/:class/:id/:resource_token/:style/:filename" | |
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
# config/application.rb | |
# This can be put in any of the "environment" files - config/application.rb is just the main | |
config.exceptions_app = ->(env) { ApplicationController.action(:exception).call(env) } | |
# If you want custom exceptions, you need to add new rescue_responses: | |
# http://guides.rubyonrails.org/configuring.html#configuring-action-dispatch | |
config.action_dispatch.rescue_response["Your::Exception"] = :bad_request |
OlderNewer