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
/** | |
* Project Item | |
*/ | |
body { | |
background-color: #f0f0f0; | |
padding: 40px; | |
} | |
.item { | |
margin: 0 0 6px; |
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
function get_path($wildcard="", $remote=false) { | |
$path = $remote ? "http://".$_SERVER['HTTP_HOST'] : $_SERVER['DOCUMENT_ROOT']; | |
if($wildcard != "") | |
$path .= "/".$wildcard."/"; | |
return $path; | |
} |
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 | |
/** | |
* IssuuClient hooks into Issuu's API | |
* | |
* example: | |
* include 'IssuuClient.php'; | |
* $issuu = new IssuuClient(pubKey, privKey, apiAdr); | |
* $issuu->openAction('issuu.document.url_upload'); | |
* $issuu->slurpUrl = 'pdfurl.pdf'; | |
* $issuu->executeAction(); |
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
!ninesixty_gutter_width ||= 20px | |
!ninesixty_grid_width ||= 960px | |
!ninesixty_columns ||= 12 | |
=grid-container | |
margin-left: auto | |
margin-right: auto | |
width = !ninesixty_grid_width | |
=grid-width(!n, !cols = !ninesixty_columns, !gutter_width = !ninesixty_gutter_width) |
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
=cf | |
display: inline-block | |
&:after | |
content: "." | |
display: block | |
height: 0 | |
clear: both | |
visibility: hidden | |
* html & | |
height: 1px |
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
# To parse a tweet from twitter to get teh '@' , '#' and the text seperated | |
parsed_text = tweet.text.gsub(/ ?(@\w+)| ?(#\w+)/) { |a| ((a.include?('#')) ? tags : replies) << a.strip.gsub(/#|@/,''); '' } |
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
# Rails modules for user controllers and models. | |
module Tiny | |
module Controller | |
module Accounts | |
def self.included(controller) | |
controller.helper_method( | |
:current_account, | |
:account_domain, | |
:account_subdomain, |
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
# Simple example | |
# Regex is between these -> \\ and my replacement string is in single quotes | |
def change_p_tags_to_divs(content) | |
content.gsub(\<.*?(p)>\, 'div') | |
end | |
# Complex example | |
# This (real) example puts `@tags` in a hyperlink, finds a path (if any) and then spits out the result. |
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 'csv' | |
CSV.open('sample_users.csv', 'r').each do |row| | |
User.create(:username => row[0], :email => row[1]) | |
end |
NewerOlder