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
@mixin base { | |
float: left; | |
margin-left: 2%; | |
&:first-child { | |
margin-left: 0; | |
} | |
} | |
@mixin grid_twelve { | |
@include base; |
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
<VirtualHost 127.0.0.1:443> | |
DocumentRoot "/Users/jordanandree/Rails/ministrycoach/public" | |
ServerName ministrycoach.dev | |
LogLevel debug | |
RackEnv development | |
RailsEnv development | |
SSLEngine On | |
SSLCertificateFile "/private/etc/apache2/server.crt" |
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
require 'rack-rewrite' | |
DOMAIN = 'www.production-hacks.com' # also works with non-www url such as 'google.com' | |
# Redirect to the www version of the domain in production | |
use Rack::Rewrite do | |
r301 %r{.*}, "http://#{DOMAIN}$&", :if => Proc.new {|rack_env| | |
rack_env['SERVER_NAME'] != DOMAIN && ENV['RACK_ENV'] == "production" | |
} | |
end |
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
## Gemfile | |
group :development do | |
gem "awesome_print", :require => "ap" | |
end | |
## ~/.irbrc | |
require "rubygems" | |
require "ap" | |
unless IRB.version.include?('DietRB') |
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
<?php | |
function postcount_query( $user_id ) { | |
// query user post count | |
return $count; | |
} | |
/* in template */ |
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
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/${0:1.5.2}/jquery.min.js"></script> |
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
<?php | |
$start = $_GET['page'] == 1 || $_GET['page'] == '' ? 0 : $_GET['page'] * $perpage; | |
$perpage = 10; | |
$query = "SELECT * FROM table LIMIT $start, $perpage"; | |
$query = mysql_query($query); | |
while($row = mysql_fetch_array($query)): | |
echo '<p>'.$row['id'].' '.$row['data'].'</p>'; | |
endwhile; |
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
<?php | |
function paginate( $total, $perpage ) | |
{ | |
$current = $_GET['page'] != '' ? $_GET['page'] : 1; | |
$paginate = '<div>'; | |
$paginate .= $current > 1 ? '<a href="?page='.($current-1).'"> « Older |</a>' : ''; | |
$paginate .= '<div>'; | |
for($i = 1; $i <= round($total/$perpage); $i++ ){ |
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
<?php | |
function ago($time) | |
{ | |
$time = strtotime($time); | |
$periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); | |
$lengths = array("60", "60", "24", "7", "4.35", "12", "10"); | |
$now = time(); | |
$difference = $now - $time; |
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
<?php | |
function siteroot() | |
{ | |
global $siteroot; | |
$siteroot = explode('/', $_SERVER['PHP_SELF']); | |
$siteroot = 'http://' . $_SERVER['SERVER_NAME'] . '/' . $siteroot[1]; | |
return $siteroot; | |
} | |
?> |