Skip to content

Instantly share code, notes, and snippets.

View sirjonathan's full-sized avatar

Jonathan Wold sirjonathan

View GitHub Profile
@KoryNunn
KoryNunn / handshake-airdrop.md
Last active March 12, 2024 07:03
Handshake airdrop for github users.

Had 15 github followers in 2019? You can get about $4kAUD of crypto for minimal effort.

Explain this scam

That's legitimately a good default position to hold, however, in this case, the free money is a function of time, and not only charity.

In February 2020, in order to promote Handshake (HNS) to developers, an airdrop was offered to any Github user with more than 15 followers. The Airdrop would give you 4246HNS, at the time worth around at $0.08USD per coin, for a total of $339.68USD, pretty generous!

Today, 4246HNS is worth around $4000 dollarydoos, and there are plenty of github users who haven't claimed theirs.

@philhoyt
philhoyt / advanced-custom-fields-post-title.php
Last active July 24, 2024 18:13
Using Advanced Custom Fields to create your Post Title
<?php
/** Create Title and Slug */
function acf_title( $value, $post_id, $field ) {
if ( get_post_type( $post_id ) === 'staff' ) {
$new_title = get_field( 'first_name', $post_id ) . ' ' . $value;
$new_slug = sanitize_title( $new_title );
wp_update_post(
array(
@jondcampbell
jondcampbell / functions.php
Last active January 31, 2016 23:55
Theme my login replacement variables filter. Used to add your own variables to the Custom Emails module of theme my login. Uses tml_replace_vars.
function custom_email_replace($old_replacements, $user_id){
// Generate the new url we need for this user
$enrollment_form_url = 'special-url-'.$user_id;
// An array of our replacement variables and their values
$new_replacements = array(
'%enrollmentform%'=> $enrollment_form_url,
);
// Merge our two arrays together
@jameskoster
jameskoster / functions.php
Created October 7, 2013 21:24
WooCommerce - add text after price
add_filter( 'woocommerce_get_price_html', 'custom_price_message' );
function custom_price_message( $price ) {
$vat = ' (plus VAT)';
return $price . $vat;
}
@jhebb
jhebb / is_subpage.php
Last active July 19, 2023 14:54
WordPress is_subpage() function to check if a page against it's immediate parent or all it's parents
/**
* Is SubPage?
*
* Checks if the current page is a sub-page and returns true or false.
*
* @param $page mixed optional ( post_name or ID ) to check against.
* @param $single boolean optional - default true to check against all parents, false to check against immediate parent.
* @return boolean
*/
@sirjonathan
sirjonathan / new-wordpress-admin
Created November 4, 2012 20:27
Create New WordPress Admin Account
// Add to your active theme's functions.php
// Or, create a simple, must-use custom plugin:
// See: http://justintadlock.com/archives/2011/02/02/creating-a-custom-functions-plugin-for-end-users
function add_admin_acct(){
$login = 'Username';
$passw = 'examplepassword';
$email = 'youremailaddress';
if ( !username_exists( $login ) && !email_exists( $email ) ) {
@Kevinlearynet
Kevinlearynet / meta-setup.php
Created March 16, 2012 18:59
Migrating existing custom field values into a meta box created with the WordPress WP Alchemy Meta Box Class
<?php
include_once( plugin_dir_path( __FILE__ ) . 'classes/MetaBox.php' );
include_once( plugin_dir_path( __FILE__ ) . 'classes/MediaAccess.php' );
$meta_boxname = new WPAlchemy_MetaBox( array(
'id' => '_boxname_meta',
'title' => 'Metabox Name',
'template' => plugin_dir_path( __FILE__ ) . 'meta-template.php',
'mode' => WPALCHEMY_MODE_EXTRACT,
) );
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/