Skip to content

Instantly share code, notes, and snippets.

View misterpah's full-sized avatar
😲
you can put status on github now ?!

pah arif misterpah

😲
you can put status on github now ?!
View GitHub Profile
@misterpah
misterpah / 0_reuse_code.js
Created May 20, 2014 04:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
$searchArgs = array(
'post_type' => 'post',
'meta_query' =>
array( 'relation' => 'AND',
array( 'key' => 'Source URL', 'value' => $postguid ),
array( 'key' => 'Source post ID', 'value' => $postid )
)
);
function get_terms_for_customPost($taxonomies, $args=array() ){
//Parse $args in case its a query string.
$args = wp_parse_args($args);
if( !empty($args['post_types']) ){
$args['post_types'] = (array) $args['post_types'];
add_filter( 'terms_clauses','wpse_filter_terms_by_cpt',10,3);
function wpse_filter_terms_by_cpt( $pieces, $tax, $args){
global $wpdb;
import haxe.macro.Context;
import haxe.macro.Expr;
class ClassNameHelper {
macro static public function getClassName():ExprOf<String> {
return { expr: EConst(CString(Context.getLocalClass().toString())), pos: Context.currentPos() }
}
}
class Test {
public static function main() {
@misterpah
misterpah / main.hx
Created June 3, 2014 17:18
crashdumper in flash
package;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.Lib;
import flixel.FlxGame;
import flixel.FlxState;
import openfl.Lib;
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
<script>
/*
alter_branding.js
webteam UTM
last updated 21 september 2014 , 11:41 pm
*/
(function(jQuery){
var thisClass = Type.getClass(this);
var b = Type.getInstanceFields(thisClass);
for (i in 0...b.length)
{
trace(b[i]);
trace(Reflect.field(this,b[i]));
}
@misterpah
misterpah / haxe_heaps_hl_hlsdl.bkc.json
Last active September 8, 2019 04:53
Haxe[4rc4] + Heaps[git] + HL[1.10.0] + hlsdl[1.10.0]
{
"bkc_checker":{"version":1},
"software":"Haxe[4rc4] + Heaps[git] + HL[1.10.0] + hlsdl[1.10.0]",
"meta":["Tested OS : Windows 10"],
"checker":{
"Haxe4.0_rc4":{
"cmdline":"haxe --version",
"expected_stdout": "<SEARCH>4.0.0-rc.4+97f1e1a9d",
"common_issue":[
"Haxe is not installed. Please download & install Haxe from url => https://haxe.org/download/version/4.0.0-rc.4/"
@misterpah
misterpah / main.go
Created July 12, 2020 01:59
golang websocket client connect with nodejs websocket server
package main
import (
"fmt"
"log"
"time"
"github.com/gorilla/websocket"
)