type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| private class PathFileObserver extends FileObserver{ | |
| static final String TAG="FILEOBSERVER"; | |
| /** | |
| * should be end with File.separator | |
| */ | |
| String rootPath; | |
| static final int mask = (FileObserver.CREATE | | |
| FileObserver.DELETE | | |
| FileObserver.DELETE_SELF | | |
| FileObserver.MODIFY | |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
| import java.util.List; | |
| public class DataList { | |
| List<Data> dataList; | |
| public List<Data> getDataList() { | |
| return dataList; | |
| } | |
| public void setDataList(List<Data> dataList) { |
| // Get The Page ID You Need | |
| get_option( 'woocommerce_shop_page_id' ); | |
| get_option( 'woocommerce_cart_page_id' ); | |
| get_option( 'woocommerce_checkout_page_id' ); | |
| get_option( 'woocommerce_pay_page_id' ); | |
| get_option( 'woocommerce_thanks_page_id' ); | |
| get_option( 'woocommerce_myaccount_page_id' ); | |
| get_option( 'woocommerce_edit_address_page_id' ); | |
| get_option( 'woocommerce_view_order_page_id' ); | |
| get_option( 'woocommerce_terms_page_id' ); |
| <?php | |
| // source: http://wordpress.stackexchange.com/questions/211703/need-a-simple-but-complete-example-of-adding-metabox-to-taxonomy | |
| // code authored by jgraup - http://wordpress.stackexchange.com/users/84219/jgraup | |
| // REGISTER TERM META | |
| add_action( 'init', '___register_term_meta_text' ); | |
| function ___register_term_meta_text() { |
| <?php | |
| function regex_range($from, $to) { | |
| if($from < 0 || $to < 0) { | |
| throw new Exception("Negative values not supported"); | |
| } | |
| if($from > $to) { | |
| throw new Exception("Invalid range $from..$to, from > to"); | |
| } |
| /*** | |
| * Regex Numeric Range Generator | |
| * Author: Erwin Yusrizal <[email protected]> | |
| * Version: 1.0.0 | |
| */ | |
| this.RegNumericRange=function(){function t(r,e,n,s){return null===n&&(n={}),this instanceof t?(this.minValue=r,this.maxValue=e,this.options=this.extend({},this.defaults,n),void(this.data={})):new t(r,e,n,s)}return t.prototype.defaults={MatchWholeWord:!1,MatchWholeLine:!1,MatchLeadingZero:!1,showProcess:!1},t.prototype.generate=function(t){var r=this.minValue.toString(),e=this.maxValue.toString(),n=[],s=[],i=[];if(!this.minValue||!this.maxValue){var a="Minimum & Maximum value is required!";if("function"==typeof t)return t({success:!1,message:a});throw new Error(a)}if(!this.isNumeric(this.minValue)||!this.isNumeric(this.maxValue)){var a="Minimum & Maximum value must numbers only!";if("function"==typeof t)return t({success:!1,message:a});throw new Error(a)}if(parseInt(this.minValue)===parseInt(this.maxValue)||parseInt(this.minValue)>parseInt(this.maxValue)){var a="Max. value must greater than Min. val |
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: Hossin Asaadi | |
| * Date: 9/2/2019 | |
| * Time: 7:43 PM | |
| */ | |
| namespace App\Traits; |
| // status bar height | |
| int statusBarHeight = 0; | |
| int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
| if (resourceId > 0) { | |
| statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
| } | |
| // action bar height | |
| int actionBarHeight = 0; | |
| final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes( |
| package asaadi.hossin.app; | |
| import android.os.Bundle; | |
| import android.support.annotation.Nullable; | |
| import android.support.v4.app.ActivityCompat; | |
| import android.support.v4.content.ContextCompat; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.util.SparseIntArray; | |
| public abstract class RuntimePermissionsActivity extends AppCompatActivity { |