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
<% Category.order(:title).each do |category| %> | |
<%= link_to category.title, category_products_path(category.id) %> | |
<% 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
gem 'motion-cocoapods' |
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 | |
// Added inside of the WufooApiWrapper Class | |
public function getEntryCountToday($identifier, $from ='forms') { | |
$url = $this->getFullUrl($from.'/'.$identifier) . '?IncludeTodayCount=true'; | |
// echo $url; | |
// die; | |
$this->curl = new WufooCurl(); |
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 | |
// secure hashing of passwords using bcrypt, needs PHP 5.3+ | |
// see http://codahale.com/how-to-safely-store-a-password/ | |
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt | |
// just an example; please use something more secure/random than sha1(microtime) :) | |
$salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22); | |
// 2a is the bcrypt algorithm selector, see http://php.net/crypt |
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
/* Click open/close Dropdown in pure CSS */ | |
/* Disclaimer: Not the most semantic | |
thing in the universe. */ | |
/* Forked from original idea | |
http://jsfiddle.net/paullferguson/Sv54G/3/ */ |
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 | |
/** | |
* Used for searching nested arrays | |
* Instead of `$user['profile']['avatar']['large']` | |
* It allows for `search_params($user, 'profile.avatar.large') | |
* | |
* Benefits | |
* - It checks if the value is set. if not returns null | |
* - makes sure the array is there. |
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
html { | |
background: #f2f2f2; | |
} | |
body { | |
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
font-weight: 300; | |
background: #fff; | |
padding: 20px; | |
margin: 40px; |
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
body { | |
margin: 100px 20px; | |
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; | |
font-weight: 300; | |
} | |
li { | |
margin-bottom: 10px; | |
} |
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 RockPaperScissors | |
attr_reader :result, :choice | |
def initialize(choice) | |
@choice = choice | |
if is_valid_choice? | |
@result = play | |
else |
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 | |
// connect to the db | |
$mysql = new mysqli('localhost', 'root', 'root', 'users'); | |
/* | |
* This is the "official" object oriented way to do it, | |
* BUT $connect_error was broken until PHP 5.2.9 and 5.3.0. | |
*/ | |
if ($mysql->connect_error) { |
OlderNewer