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
# note: Must install pymysql: `pip3 install pymysql` | |
import pymysql | |
conn= pymysql.connect(host='localhost',user='root',password='password',db='s1',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor) | |
a=conn.cursor() | |
sql='CREATE TABLE `users` (`id` int(11) NOT NULL AUTO_INCREMENT,`email` varchar(255) NOT NULL,`password` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;' | |
a.execute(sql) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<ruleset name="BAD GAZELLE"> | |
<description>Created with the PHP Coding Standard Generator. http://edorian.github.com/php-coding-standard-generator/ | |
</description> | |
<arg name="tab-width" value="2"/> | |
<rule ref="Generic.Classes.DuplicateClassName"/> | |
<rule ref="Generic.CodeAnalysis.EmptyStatement"/> | |
<rule ref="Generic.CodeAnalysis.JumbledIncrementer"/> | |
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/> | |
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<input type="text" id="input"> | |
<pre id="output"></pre> |
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 | |
<?php | |
$query = new EntityFieldQuery(); | |
$entities = $query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', 'event') | |
->propertyCondition('status', 1) | |
->fieldCondition('field_date', 'value', array('2011-03-01', '2011-03-31'), 'BETWEEN') | |
->fieldOrderBy('field_date', 'value', 'ASC') | |
->execute(); |
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
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_extra_bottom": 1, | |
"caret_extra_top": 1, | |
"caret_extra_width": 1, | |
"caret_style": "blink", | |
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Monokai.tmTheme", | |
"fade_fold_buttons": false, | |
"font_face": "hermit", |
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
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_extra_bottom": 1, | |
"caret_extra_top": 1, | |
"caret_extra_width": 1, | |
"caret_style": "blink", | |
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Monokai.tmTheme", | |
"fade_fold_buttons": false, | |
"font_face": "hermit", |
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
<script type="text/javascript"> | |
(function(){ | |
var s = document.createElement('script'); | |
s.type = 'text/javascript'; | |
a.async = true; | |
s.src = ''; | |
var x = document.getElementsByTagName('script')[0]; | |
x.parentNode.insertBefore(s, x); | |
})(); | |
</script> |
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
function slugify( $str ) { | |
$new_str = $str; | |
$new_str = preg_replace('/ /', '-', $new_str); | |
$new_str = preg_replace('/[^A-Za-z0-9\-]/', '', $new_str); | |
$new_str = strtolower($new_str); | |
return $new_str; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>MC TEST</title> | |
</head> | |
<body> | |
<?php | |
define('CLIENT_ID', ''); |
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 generate_awesome_excerpt( $id, $character_limit, $ending ) { | |
if( gettype($character_limit) != 'integer' ) { | |
$character_limit = 100; | |
} | |
$post = get_post($id); | |
$content = $post->post_content; |