View search.js
var search = location.search.split('search=')[1]; // URL variable from search action
const data = { // JSON data (Will become an ajax URL call...)
"Feed": [
{
"categories":"empty",
"content":"Definitions\n",
"tags":"empty",
"title":"Definitions",
"uri":"http://localhost:1313/wfs-design-framework/definitions/"
View facebook-messenger-bot.php
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}
View Auto_Type.js
<textarea id="input"></textarea>
<div id="output"></div>
$('#input').keyup(function(){
$('#output').text($(this).val());
});
View tumblr-photosets-fixed.js
function resizePhotosets(){
var parentWidth = document.body.querySelector('.html_photoset').offsetWidth;
var photosets = document.body.querySelectorAll('iframe.photoset');
for(var i = 0; i < photosets.length; ++i){
var photoset = photosets[i];
photoset.width = parentWidth;
}
}
window.onload = resizePhotosets;
window.onresize = resizePhotosets;
View Create_File.php
<?php
$fp=fopen('filename.php','w');
fwrite($fp, 'data to be written');
fclose($fp);
?>
View unzip.php
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'Something went wrong?';
View tumblr_template.html
<!DOCTYPE html>
<html>
<head>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<meta charset="utf-8">
<title>{Title}</title>
<link rel="shortcut icon" href="{Favicon}">
View Login-registration
http://www.codingcage.com/2015/01/user-registration-and-login-script-using-php-mysql.html
// SQL
CREATE TABLE `users` (
`user_id` int(5) NOT NULL AUTO_INCREMENT,
`username` varchar(25) COLLATE latin1_general_ci NOT NULL,
`email` varchar(35) COLLATE latin1_general_ci NOT NULL,
`password` varchar(50) COLLATE latin1_general_ci NOT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `email` (`email`)
View Post_database
// HTML Form w/ viewer for the data
<form action="post.php" method="post">
<input type="text" name="title" placeholder="Title"/>
<input type="text" name="description" placeholder="Description"/>
</form>
<?php
mysql_connect("", "", "") or die(mysql_error()) ;
mysql_select_db("") or die(mysql_error()) ;
View database_text
CREATE TABLE IF NOT EXISTS `text` (
`title` varchar(250) character set latin1 collate latin1_general_ci default NULL,
`text` varchar(250) character set latin1 collate latin1_general_ci default NULL
)