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
<template> | |
</template> | |
<script> | |
export default { | |
} | |
</script> | |
<style lang="scss"> |
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
function emailIsValid (email) { | |
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) | |
} |
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
UPDATE `table` SET `field` = CONVERT(BINARY CONVERT(`field` USING latin1) USING utf8); |
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 = array( | |
'title' => 'My title', | |
'name' => 'My Name', | |
'date' => 'My date' | |
); | |
$sql = $this->db->set($data)->get_compiled_insert('mytable'); | |
echo $sql; |
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
# REMOVE WWW | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^your-site.com$ [NC] | |
RewriteRule ^(.*)$ http://your-site.com/$1 [L,R=301] | |
# PREVENT HOTLINKING | |
RewriteEngine On | |
#Replace ?mysite\.com/ with your blog url | |
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC] | |
RewriteCond %{HTTP_REFERER} !^$ |
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
$states = array( | |
'AL'=>'ALABAMA', | |
'AK'=>'ALASKA', | |
'AZ'=>'ARIZONA', | |
'AR'=>'ARKANSAS', | |
'CA'=>'CALIFORNIA', | |
'CO'=>'COLORADO', | |
'CT'=>'CONNECTICUT', | |
'DE'=>'DELAWARE', | |
'FL'=>'FLORIDA', |
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
$this->output | |
->set_content_type('application/json') | |
->set_output(json_encode(array('foo' => 'bar'))); |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L] |
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 ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class Pages_model extends CI_Model { | |
public $variable; | |
public function __construct() | |
{ | |
parent::__construct(); | |
$this->load->database(); |
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
public function __construct() | |
{ | |
parent::__construct(); | |
$this->load->model(array()); | |
$this->load->helper(array()); | |
$this->load->library(array()); | |
$this->data = []; | |
} |