Skip to content

Instantly share code, notes, and snippets.

View ayublin's full-sized avatar

Ayub ayublin

  • Vafour
  • Malang, Indonesia
View GitHub Profile
@ayublin
ayublin / BootupTapdaqCallbacks.java
Last active August 27, 2016 19:00
Tapdaq Android Universal Bootup Callback
package com.company.myawesomeapp;
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;
// 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
ayublin / WP regenerate attachment meta data
Last active December 24, 2015 13:39
Regenerate attachment meta data
<?php
// get all attachments
$attachments = get_posts( array(
'post_type' => 'attachment',
'posts_per_page' => -1,
) );
foreach($attachments as $attach)
{
@ayublin
ayublin / hgignore_forget
Created August 9, 2012 11:35
[mercurial] Forget all files defined in .hgignore
hg forget "set:hgignore() and not ignored()"