Skip to content

Instantly share code, notes, and snippets.

View smartcatdev's full-sized avatar

Bilal Hassan smartcatdev

  • Bilal Hassan
  • Kingston, Ontario
  • 16:53 (UTC -04:00)
View GitHub Profile
var icons=""
$('ul.icon-list > li').each( function() {
icons += "'" + $('i', this ).attr('class') + "' => __('" + $('span', this ).html() + "', 'buildr' ),";
/* console.log( $('i', this ).attr('class') ) */
})
console.log( icons )
@smartcatdev
smartcatdev / fontawesome5-php-array.php
Created April 27, 2018 18:40
Font Awesome 5 - Icon PHP Array
function fa_icons() {
return array (
'fab fa-500px' => __( '500px', 'buildr' ),
'fab fa-accessible-icon' => __( 'accessible-icon', 'buildr' ),
'fab fa-accusoft' => __( 'accusoft', 'buildr' ),
'fas fa-address-book' => __( 'address-book', 'buildr' ),
'far fa-address-book' => __( 'address-book', 'buildr' ),
'fas fa-address-card' => __( 'address-card', 'buildr' ),
'far fa-address-card' => __( 'address-card', 'buildr' ),
.autocomplete-suggestions {
text-align: left; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
/* core styles should not be changed */
position: absolute; display: none; z-index: 9999; max-height: 350px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
}
.autocomplete-suggestion { font-family: 'Open Sans', sans-serif; position: relative; padding: 16px 16px; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
.autocomplete-suggestion b { font-weight: normal; color: #1f8dd6; }
.autocomplete-suggestion.selected { background: #f0f0f0; }
// JavaScript autoComplete v1.0.4
// https://github.com/Pixabay/JavaScript-autoComplete
var autoComplete=function(){function e(e){function t(e,t){return e.classList?e.classList.contains(t):new RegExp("\\b"+t+"\\b").test(e.className)}function o(e,t,o){e.attachEvent?e.attachEvent("on"+t,o):e.addEventListener(t,o)}function s(e,t,o){e.detachEvent?e.detachEvent("on"+t,o):e.removeEventListener(t,o)}function n(e,s,n,l){o(l||document,s,function(o){for(var s,l=o.target||o.srcElement;l&&!(s=t(l,e));)l=l.parentElement;s&&n.call(l,o)})}if(document.querySelector){var l={selector:0,source:0,minChars:3,delay:150,offsetLeft:0,offsetTop:1,cache:1,menuClass:"",renderItem:function(e,t){t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");var o=new RegExp("("+t.split(" ").join("|")+")","gi");return'<div class="autocomplete-suggestion" data-val="'+e+'">'+e.replace(o,"<b>$1</b>")+"</div>"},onSelect:function(){}};for(var c in e)e.hasOwnProperty(c)&&(l[c]=e[c]);for(var a="object"==typeof l.selector?[l.selector]:document.querySelectorAll(l.s
(function () {
/****************************************************************************
* GLOBAL CONSTANTS, ASSETS, AND TEMPLATES
****************************************************************************/
/* global google autoComplete */
/* eslint no-console: 0 */
var LOG_PREFIX = 'ts-signup: ';
For 1 : Objects do not get garbaged with the forced System.gc() and the System.runFinalization() because there is inner class Action instance inside the SomeSubscriber class. This instance of the inner class contains a hidden reference to its parent instance SomeSubscriber. The inner class Action will prevent the associated instances of the SomeSubscriber from being garbage collected.
For 2 : A call to methodB will hold the lock on the object sync, so no other threads are allowed to enter and synchronized block with this lock. Now, methodB calls methodA which also holds a lock on sync object. Method A will wait for methodA to complete and frees the lock which never happens. This causes a deadlock.
For 3 : Same thing as for (2) methodB calls isDepleted and these two methods hold a lock on this.processing. They will be waiting for each others.
For 4 :
class MyClass {
private final List<String> collection = new ArrayList<>();
<?php if( class_exists( 'WooCommerce' ) ) : ?>
<div class="athena-mobile-cart">
<a class="athena-cart" href="<?php echo WC()->cart->get_cart_url() ; ?>"><span class="fa fa-shopping-cart"></span> <?php echo WC()->cart->get_cart_total(); ?></a>
</div>
<?php endif; ?>
/**************************
*
* GENERAL
*
**************************/
.camera_wrap a, .camera_wrap img,
.camera_wrap ol, .camera_wrap ul, .camera_wrap li,
.camera_wrap table, .camera_wrap tbody, .camera_wrap tfoot, .camera_wrap thead, .camera_wrap tr, .camera_wrap th, .camera_wrap td
.camera_thumbs_wrap a, .camera_thumbs_wrap img,
.camera_thumbs_wrap ol, .camera_thumbs_wrap ul, .camera_thumbs_wrap li,
@smartcatdev
smartcatdev / additional_meta.php
Last active October 8, 2015 14:49
This wil help you create a custom meta. it has not been tested
<?php
add_action('add_meta_boxes', 'ceo_tribe_image_meta_box' );
public function ceo_tribe_image_meta_box() {
add_meta_box(
'page_info_box_permission', __('Page Permission', 'tribe'), 'page_info_box_format', 'page', 'side', 'low'
);