Skip to content

Instantly share code, notes, and snippets.

View Tmeister's full-sized avatar
🇲🇽
Working from home

Enrique Chavez Tmeister

🇲🇽
Working from home
View GitHub Profile
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
@Tmeister
Tmeister / gist:5f39434e9b41d89c73b1
Created September 18, 2014 14:42
Fetch a Full Website using wget
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains domain.com \
--no-parent \
http://domain.com
@Tmeister
Tmeister / gist:decb8ae0e92c0864f185
Last active August 29, 2015 14:07
NoHat Popup - Sec
$(function(){
function secSetCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
}
function secGetCookie (cname) {
var name = cname + "=";
$(function(){
var fileRef = document.createElement('script');
fileRef.setAttribute("type","text/javascript");
fileRef.setAttribute("src", "//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js");
document.body.appendChild(fileRef);
/*Change the SELECTOR-HERE for the one you want to add */
$("SELECTOR-HERE").append('<br/><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4429314952077491" data-ad-slot="8849066704" data-ad-format="auto"></ins>');
$("SELECTOR-HERE").append('<script>(adsbygoogle = window.adsbygoogle || []).push({});</script>');
});
@Tmeister
Tmeister / gist:932cb1f1d528839cd4fd
Created December 2, 2014 20:17
Activation Cron Job
<?php
register_activation_hook( __FILE__, 'my_cron_activation' );
function my_cron_activation() {
wp_schedule_event( time(), 'hourly', 'my_cron_action' );
}
<?php
add_action( 'my_cron_action', 'do_magic' );
function do_magic() {
// do something every hour
}
<?php
add_filter( 'cron_schedules', 'add_custom_cron_schedule' );
function add_custom_cron_schedule( $schedules ){
$schedules['minute'] = array(
'interval' => 60 * 1,
'display' => __('Every Minute')
);
return $schedules;
}
<?php
register_activation_hook( __FILE__, 'my_cron_activation' );
function my_cron_activation() {
wp_schedule_event( time(), 'minute', 'my_cron_action' );
}
@Tmeister
Tmeister / sample.json
Created April 20, 2015 19:28
JSON options
"lessons" : [
{
"title" : "I'm a rating question dude!",
"content" : "<p>This i sthe content input</p>",
"action" : {
"title" : "Some Rating fields!!!!",
"icon" : "dollar",
"type" : "rating",
"content" : "This is where the question or action description goes. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium.",
"time": "10",
{
"version" : 1.0,
"name" : "podcast",
"primary_color" : "",
"accent_color" : "#0000ff",
"text_color": "",
"header" : {
"header_img" : "//impactful.io/tutorize/app/assets/images/bg-header.jpg",
"title" : "New! How to Start a Podcast<br>Step-By-Step Podcasting Tutorial"
},