Skip to content

Instantly share code, notes, and snippets.


Ayub ayublin

  • Vafour
  • Malang, Indonesia
View GitHub Profile
ayublin /
Last active August 27, 2016 19:00
Tapdaq Android Universal Bootup Callback
import android.content.Context;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;
import com.tapdaq.sdk.Tapdaq;
import com.tapdaq.sdk.TapdaqCallbacks;
View WP Post Formats Adding New Field
// add new field under gallery post format forms ui
add_action( 'vp_pfui_after_gallery_meta', 'mytheme_add_gallery_type_field' );
// handle the saving of our new field
add_action( 'admin_init' , 'mytheme_admin_init' );
function mytheme_admin_init() {
$post_formats = get_theme_support('post-formats');
if (!empty($post_formats[0]) && is_array($post_formats[0])) {
if (in_array('gallery', $post_formats[0])) {
ayublin / WP regenerate attachment meta data
Last active December 24, 2015 13:39
Regenerate attachment meta data
View WP regenerate attachment meta data
// get all attachments
$attachments = get_posts( array(
'post_type' => 'attachment',
'posts_per_page' => -1,
) );
foreach($attachments as $attach)
ayublin / hgignore_forget
Created August 9, 2012 11:35
[mercurial] Forget all files defined in .hgignore
View hgignore_forget
hg forget "set:hgignore() and not ignored()"