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
@Tmeister
Tmeister / gist:9648208
Created March 19, 2014 18:32
Collision Checker
if( heroBounces.intersects(play.enemy.getBounds(play)) || heroBounces.intersects(play.enemy1.getBounds(play)))
{
play.over();
}
@Tmeister
Tmeister / gist:9648242
Last active August 29, 2015 13:57
Hero Jumping
public function update():void
{
if( _isJumping )
{
this.y -= ( jumpPower - gravity);
jumpPower -= 2;
if(this.y + gravity > groundBase)
{
this.y = groundBase;
@Tmeister
Tmeister / menu-locator.php
Created March 31, 2014 18:53
Find a TOP parent menu object according to the current page viewed
<?php
/**
* Menu Inspector
*
* Find a TOP parent menu object according to the current page viewed
*
* @package MenuLocator
* @author Enrique Chavez <noone@tmeister.net>
* @license GPL-2.0+
<?php
function ec_mail_name( $email ){
return 'Joe Doe'; // new email name from sender.
}
add_filter( 'wp_mail_from_name', 'ec_mail_name' );
<?php
function ec_mail_from ($email ){
return 'joe@doe.com'; // new email address from sender.
}
add_filter( 'wp_mail_from', 'ec_mail_from' );
@Tmeister
Tmeister / custom.css
Created August 22, 2014 17:15
Custom CSS to Add Logo to Voyant Mobile Menu
.section-menu-voyant .voyant-mobile-nav .voyant-menu-holder{
width: 100%;
margin-left: 0;
}
.section-menu-voyant .voyant-mobile-nav .voyant-menu-holder:before{
/*Replace with your logo URL*/
background: url('http://3z6cyh36dph41r69gi2tjn07r24.wpengine.netdna-cdn.com/wp-content/uploads/2014/04/voyant4.png') no-repeat;
background-size: contain;
background-position-y: 5px;
@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' );
}