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
$simpsons = array('bart', 'lisa', 'homer'); | |
echo in_array_r("bart", $simpsons) ? 'found' : 'not found'; |
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
/* http://css-tricks.com/snippets/css/truncate-string-with-ellipsis/ */ | |
.truncate { | |
width: 250px; | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} |
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
# Just use the -f option to change the source | |
# ln -s source target | |
ln -s /home/Data1 /home/Stores/abc | |
ln -f -s /home/Data2 /home/Stores/abc |
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
$databases = array ( | |
'default' => | |
array ( | |
'default' => | |
array ( | |
'database' => 'dbname_db', | |
'username' => '', | |
'password' => '', | |
'host' => '127.0.0.1', | |
'port' => '', |
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
drush vset preprocess_css 0 --yes | |
drush vset preprocess_js 0 --yes | |
drush cc css-js |
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
=begin | |
This program calculates the amount to charge a client using Square as a payment processor. | |
The variation in cost depends largely on if the credit card is present. | |
=end | |
puts "--------------------------------------" | |
puts "---Welcome to the Square Calculator---" | |
puts "--------------------------------------" | |
# Output commas in large number |
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
$url = parse_url(getenv('DATABASE_URL')); // Be sure to run [heroku config:set DATABASE_URL=mysql://db_username:db_password@amazon_rds_instance_name/db_name] | |
$databases['default']['default'] = array( | |
// MySQLi uses the mysql driver. | |
'driver' => $url['scheme'] == 'mysqli' ? 'mysql' : $url['scheme'], | |
// Remove the leading slash to get the database name. | |
'database' => substr(urldecode($url['path']), 1), | |
'username' => urldecode($url['user']), | |
'password' => isset($url['pass']) ? urldecode($url['pass']) : '', | |
'host' => urldecode($url['host']), | |
'port' => isset($url['port']) ? urldecode($url['port']) : '', |
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
git push heroku yourbranch:master |
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 | |
$root = $_SERVER['DOCUMENT_ROOT']; | |
chdir($root); | |
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); | |
set_include_path(get_include_path().':'.__DIR__); | |
if(file_exists($root.$path)) | |
{ | |
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') | |
$path = rtrim($path,'/').'/index.php'; |
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
# Read about factories at https://github.com/thoughtbot/factory_girl | |
FactoryGirl.define do | |
factory :user do | |
email: "[email protected]" | |
factory :facilitator, :class => Facilitator do | |
sequence(:email) { |n| "facilitator#{n}@example.com" } | |
after(:build) { |pm| pm.company = FactoryGirl.build(:property_management_company) } | |
before(:create) { |pm| pm.company = FactoryGirl.create(:property_management_company) } | |
OlderNewer