This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert the hex color to rgba. | |
* @param $hex - #fa11cc | |
* @param mixed $alpha - from 0.0 to 1.0 | |
* @return array rgba | |
*/ | |
function hexToRgb($hex, $alpha = false) | |
{ | |
$hex = str_replace('#', '', $hex); | |
$length = strlen($hex); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//register below activity | |
<activity | |
android:name="com.theartofdev.edmodo.cropper.CropImageActivity" | |
android:theme="@style/Base.Theme.AppCompat" /> | |
<activity android:name=".ImagePickerActivity"></activity> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.ParseError; | |
import com.android.volley.Request; | |
import com.android.volley.Response; | |
import com.android.volley.VolleyError; | |
import com.android.volley.toolbox.HttpHeaderParser; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import java.util.Timer; | |
import java.util.TimerTask; | |
public class RepeatTaskTimer extends TimerTask { | |
private long timeInMillis; | |
private long delay; | |
private long finishTime; | |
private Listener listener; | |
private Activity activity; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import androidx.appcompat.app.AlertDialog; | |
import androidx.appcompat.widget.AppCompatEditText; | |
import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.DatePickerDialog; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.DatePicker; | |
import androidx.appcompat.widget.AppCompatEditText; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function observe(selector,data,listener=null) { | |
let parent = document.querySelector(selector); | |
let allBind = parent.querySelectorAll('[data-bind]'); | |
const get = (target, key, receiver)=>{ | |
const result = Reflect.get(target, key, receiver); | |
return result; | |
} | |
const set = (target,key,value,receiver)=>{ | |
Reflect.set(target, key, value, receiver); | |
updateBinding(key,value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bsPopup(title = 'Alert', msg = 'Are you sure?') { | |
return new Promise((resolve, reject) => { | |
const autoId = 'modal' + new Date().getTime(); | |
const modal = ` | |
<div class="modal fade" id="${autoId}" tabindex="-1"> | |
<div class="modal-dialog modal-dialog-centered" role="document"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<h5 class="modal-title"><i class="fa fa-exclamation-triangle mr-1"></i> ${title}</h5> | |
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div.table-mini-container { | |
overflow: auto; | |
min-width: 100px; | |
} | |
table.table-mini { | |
width: 100%; | |
border-collapse: collapse; | |
font-size: 0.85rem; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param $filename string filename | |
* @return string mime-type of file | |
*/ | |
private function getMimeContentType($filename) | |
{ | |
$ar = explode(".", $filename); | |
$ext = $ar[count($ar) - 1]; | |
$mime_types = array( | |
'.3dm' => 'x-world/x-3dmf', |