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
PROJECT_NAME=XXXXXXXXXXXXXX | |
APP_NAME=api | |
BASE_DIR=$PROJECT_NAME/apps/$APP_NAME | |
mkdir -p $BASE_DIR | |
django-admin.py startapp $APP_NAME $BASE_DIR | |
mkdir -p $BASE_DIR/static/$APP_NAME/{css,js,img} | |
echo '' > $BASE_DIR/static/$APP_NAME/css/.gitkeep | |
echo '' > $BASE_DIR/static/$APP_NAME/js/.gitkeep | |
echo '' > $BASE_DIR/static/$APP_NAME/img/.gitkeep |
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
<span class="fa-stack fa-lg danger"> | |
<i class="fa fa-circle fa-stack-2x"></i> | |
<i class="fa fa-times fa-stack-1x fa-inverse"></i> | |
</span> |
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
def tester(insert=False, value={}): | |
if insert: | |
value['insert'] = True | |
print(value) | |
tester(insert=False) | |
tester(insert=True) | |
tester(insert=False) |
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
""" | |
A perl Data.Dumper clone for Python | |
Author: simon@log4think.com | |
2011-07-08 | |
""" | |
#!/bin/env python | |
import sys | |
from types import * |
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
#sectionFeatures p img, #sectionDining p img { | |
width: 100%; | |
background-position: center; | |
background-size: cover; | |
} | |
#sectionDining p { | |
width: 306px; | |
height: 219px; |
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 | |
$conn = mysql_connect('yourserver','yourusername','yourpassword'); | |
echo "<html><head><META HTTP-EQUIV='Refresh' CONTENT='2; URL=".$_SERVER['PHP_SELF']."'><body>"; | |
echo "<table><th>ID</th><th>DATABASE</th><th>QUERY</th><th>EXECUTION TIME</th><th>STATE</th>"; | |
$res = mysql_query("show processlist"); | |
while($row = mysql_fetch_assoc($res)) | |
{ | |
if (stristr($row['State'],"Has sent all binlog to slave")) | |
{ | |
continue; |
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 | |
define('CLIENT_LONG_PASSWORD',1); /* new more secure passwords */ | |
define('CLIENT_FOUND_ROWS',2); /* Found instead of affected rows */ | |
define('CLIENT_LONG_FLAG',4); /* Get all column flags */ | |
define('CLIENT_CONNECT_WITH_DB',8); /* One can specify db on connect */ | |
define('CLIENT_NO_SCHEMA',16); /* Don't allow database.table.column */ | |
define('CLIENT_COMPRESS',32); /* Can use compression protocol */ | |
define('CLIENT_ODBC',64); /* Odbc client */ | |
define('CLIENT_LOCAL_FILES',128); /* Can use LOAD DATA LOCAL */ | |
define('CLIENT_IGNORE_SPACE',256); /* Ignore spaces before '(' */ |
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 | |
if (array_key_exists('user',$_REQUEST)) | |
{ | |
if (!is_dir($_REQUEST['repo'])) | |
{ | |
system("mkdir {$_REQUEST['repo']} && cd {$_REQUEST['repo']} && git init && git pull git://github.com/{$_REQUEST['user']}/{$_REQUEST['repo']}.git master"); | |
} | |
else | |
{ |
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 | |
$caseInsensitivePosts = array('your_desired_cleaned_lower_case_post_var'); | |
foreach($_GET as $k=>$v) | |
{ | |
$lower = strtolower($k); | |
foreach ($caseInsensitivePosts as $requestVal) | |
{ | |
if ($requestVal == $lower && $k !== $requestVal) | |
{ |
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
Edit cron tab to point to this file and run php script every one minute: | |
*/1 * * * * php /yourpath/phpFatals.php web01 | |
*/1 * * * * php /yourpath/phpFatals.php cron01 | |
*/1 * * * * php /yourpath/phpFatals.php etcetc | |
Edit the below variables: |