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
<IfModule mod_rewrite.c> | |
<IfModule mod_negotiation.c> | |
Options -MultiViews | |
</IfModule> | |
RewriteEngine On | |
# Redirect Trailing Slashes If Not A Folder... | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)/$ /$1 [L,R=301] |
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
var mongoose = require('mongoose'),Schema = mongoose.Schema; | |
var bcrypt = require('bcrypt'); | |
var salt = bcrypt.genSaltSync(10); | |
var enc_password = password = bcrypt.hashSync(req.body.password, salt); |
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 | |
function format_uri( $string, $separator = '-' ) | |
{ | |
$accents_regex = '~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i'; | |
$special_cases = array( '&' => 'and', "'" => ''); | |
$string = mb_strtolower( trim( $string ), 'UTF-8' ); | |
$string = str_replace( array_keys($special_cases), array_values( $special_cases), $string ); | |
$string = preg_replace( $accents_regex, '$1', htmlentities( $string, ENT_QUOTES, 'UTF-8' ) ); | |
$string = preg_replace("/[^a-z0-9]/u", "$separator", $string); |
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 | |
/** | |
* Takes in a filename and an array associative data array and outputs a csv file | |
* @param string $fileName | |
* @param array $assocDataArray | |
*/ | |
public function outputCsv($fileName, $assocDataArray) | |
{ | |
ob_clean(); |