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 | |
// 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 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 | |
class FlashMessages { | |
private $messages = array(); | |
private $now = false; | |
private static $instance = null; | |
private function __construct() { | |
// Save all messages | |
$this->messages = $_SESSION['flash_messages']; |
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 | |
// 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 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
# Baylor Rae's Prompt Theme | |
# based on wunjo prompt theme and modified for oh-my-zsh | |
# shows me all files and folders when I change directories | |
cd() { builtin cd "$@"; ls } | |
# uses ~ instead of /Users/baylorrae/ | |
pwd() { print -D $PWD } | |
# I substituted my own so the commit times were live |
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 | |
class PubSub { | |
private static $events = array(); // all subscriptions | |
// Don't allow PubSub to be initialized outside this class | |
private function __construct() {} | |
private function __clone() {} | |
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
/* 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 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 | |
/** | |
* 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 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
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 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
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 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
class RockPaperScissors | |
attr_reader :result, :choice | |
def initialize(choice) | |
@choice = choice | |
if is_valid_choice? | |
@result = play | |
else |
OlderNewer