Skip to content

Instantly share code, notes, and snippets.

View RiFi2k's full-sized avatar

Reilly Lowery RiFi2k

View GitHub Profile
# https://www.parrotsec.org/doc/persistence.fx
# For persistence: (File Name=parrot-rw, Volume Name=persistence) <<< NOT casper-rw !!!!!!
# 1. Click 'Create ext2/3/4 fs' in RMPrepUSB
# 2. Set the FILENAME to parrot-rw
# 3. Set the VOLUME LABEL to persistence <------ VERY IMPORTANT: DO NOT CHANGE
# 4. Set amount of space you would like allowed to persist
# 5. Choose ext4
# The persistent 'volume' needs the persistence.conf file in it!
*filter
# Base policy
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Don't attempt to firewall internal traffic on the loopback device.
-A INPUT -i lo -j ACCEPT
*filter
# Base policy
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Don't attempt to firewall internal traffic on the loopback device.
-A INPUT -i lo -j ACCEPT
add_action( 'admin_menu', 'add_my_admin_menus' );
/**
* Create the administration menus in the left-hand nav and load the JavaScript conditionally only on that page
*/
function add_my_admin_menus(){
$my_page = add_menu_page( 'Page Title', 'Menu Title', MY_ADMIN_CAPABILITY, 'menu-slug', 'show_page_content' );
// Load the JS conditionally
add_action( 'load-' . $my_page, 'load_admin_js' );
//add_action( 'template_redirect', 'usasf_check_forsale' );
function usasf_check_forsale() {
if ( is_singular( 'tribe_events' ) ) {
$post_object = get_queried_object();
$post_id = get_queried_object_id();
$regional = get_field( 'is_regional_event', $post_id );
if ( ! $regional ) {
return;
// Add the hook action
add_action('transition_post_status', 'send_new_post', 10, 3);
// Listen for publishing of a new post
function send_new_post($new_status, $old_status, $post) {
if('publish' === $new_status && 'publish' !== $old_status && $post->post_type === 'post') {
// Do something!
}
}
//add_action( 'save_post_tribe_events', 'usasf_save_events', 10, 3 );
function usasf_save_events( $post_id, $post, $update ) {
// verify if this is an auto save routine.
// If it is our form has not been submitted, so we dont want to do anything
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
// Check permissions
if ( 'page' == $post->post_type ) {
<noscript>
<style type="text/css">
.pagecontainer {display:none;}
</style>
<div class="noscriptmsg">
You don't have javascript enabled. Good luck with that.
</div>
</noscript>
<?php
class GFFormDisplay{
public static $submission = array();
private static $init_scripts = array();
const ON_PAGE_RENDER = 1;
const ON_CONDITIONAL_LOGIC = 2;
public static function process_form($form_id){
// This filter is executed during form load. When set to true, the form init scripts are loaded
// in the footer of the site, instead of the default location of which is in the page
// body immediately after the form.
add_filter( 'gform_init_scripts_footer', '__return_true' );
// This example dynamically adds a custom class to all text fields
add_filter( 'gform_field_css_class', 'custom_class', 10, 3 );
function custom_class( $classes, $field, $form ) {
if ( $field->type == 'text' ) {
$classes .= ' custom_textfield_class';