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
export KEYCHAIN_ITEM='email' && curl -u `security find-generic-password -s ${KEYCHAIN_ITEM} | grep 'acct' | cut -c 19- | tr -d '"' | tr -d '\n'`:`security find-generic-password -w -s ${KEYCHAIN_ITEM}` --silent "https://mail.google.com/mail/feed/atom" | perl -ne 'print "$2\n" if /<(email)>(.*)<\/\1>/;' | wc -l | tr -d ' ' |
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
$('[data-plugin]').each(function(element) | |
{ | |
switch ($(element).data('plugin')) | |
{ | |
case 'tagsInput': | |
$(element).tagsInput({ width: 'auto' }); | |
break; | |
} | |
}); |
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 | |
$conditions = array('conditions' => array('revision_id' => $recipe_revision->record['id'])); | |
$cache_key = 'RECIPE-' . $recipe_revision->record['id'] . '-'; | |
$recipe_ingredient = new RecipeIngredient($conditions, $cache_key . 'INGREDIENTS'); | |
$recipe_direction = new RecipeDirection($conditions, $cache_key . 'DIRECTIONS'); |
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
// Checks that all of the fields are present and not null | |
if (isset($_POST['username'], $_POST['email'], $_POST['password']) | |
&& !String::isEmpty($_POST['username'], $_POST['email'], $_POST['password'])) | |
{ | |
// Checks that the username is the correct format | |
if (strlen($_POST['username']) > 32) | |
{ | |
$message = 'Usernames may not be more than 32 characters.'; | |
} | |
elseif (!preg_match('/^[a-z0-9-]+$/i', $_POST['username'])) |
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 user_create extends AnonymousModule | |
{ | |
protected $post = array( | |
'username' => array( | |
'length:>:32' => 'Usernames may not be more than 32 characters.', | |
'regex:/[^a-z0-9-]+/i' => 'Usernames may only contain alphanumeric characters or dashes.', | |
'regex:/^(-.+|.+-)$/' => 'Usernames may not start or end with a dash.', | |
'regex:/-{2,}/' => 'Usernames may not have two or more dashes in a row.', |
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 | |
if (isset($_SERVER['HTTP_USER_AGENT']) | |
&& !String::isEmpty($_SERVER['HTTP_USER_AGENT']) | |
&& !preg_match('/(Baidu|Gigabot|Googlebot|libwww-perl|lwp-trivial|msnbot|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg)/i', $_SERVER['HTTP_USER_AGENT'])) | |
{ | |
exit('EOF'); | |
session_start(); | |
} |
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 | |
$transaction = new Transaction(); | |
$model1 = new Model1(); | |
$model1->record['foo'] = 'bar'; | |
$model1->queue(); | |
$transaction->queue($model1); |
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 | |
/** | |
* Smarty State Drop Down for PICKLES | |
* | |
* PICKLES is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as | |
* published by the Free Software Foundation, either version 3 of | |
* the License, or (at your option) any later version. | |
* |
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
$reward = new MerchantReward(); | |
for ($i = 1; $i <= 50; $i += 5) | |
{ | |
$reward->record['merchant_id'] = '1'; | |
$reward->record['location_id'] = '1'; | |
$reward->record['reward'] = 'This is a reward'; | |
$reward->record['visits'] = $i; | |
$reward->queue(); | |
} |
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 | |
/** | |
* Prepare Variables | |
* | |
* Processes the request variable and creates all the variables that the | |
* Controller needs to load the page. | |
* | |
* @param string $basename the requested page | |
* @return array the resulting variables |