Skip to content

Instantly share code, notes, and snippets.

View abedputra's full-sized avatar
😄
LoveToCode

Abed Putra abedputra

😄
LoveToCode
View GitHub Profile
package com.example.attendacewithfingerprintinternal;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.location.Location;
import android.os.Bundle;
@abedputra
abedputra / DuskTestCase.php
Created May 8, 2018 02:39
Dust test with option, disable gpu and headless
<?php
namespace Tests;
use Laravel\Dusk\TestCase as BaseTestCase;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Chrome\ChromeOptions;
abstract class DuskTestCase extends BaseTestCase
@abedputra
abedputra / index.php
Created September 7, 2017 07:48
Check Firefox or Chrome with PHP
<?php
function is_chrome()
{
return(eregi("chrome", $_SERVER['HTTP_USER_AGENT']));
}
if(is_chrome())
{
echo "its Chrome";
}
@abedputra
abedputra / compress.php
Last active November 17, 2023 04:36
Compress HTML output with CodeIgniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function compress()
{
$CI =& get_instance();
$buffer = $CI->output->get_output();
$search = array(
'/\>[^\S ]+/s',
'/[^\S ]+\</s',
@abedputra
abedputra / Gravatar.php
Created August 28, 2017 05:52
Simple load a gravatar php
<?php
//Simple load a gravatar php.
function gravatar($email = '', $rating = 'pg') {
$default = "path/to/defava.png"; // Set a Default Avatar
$email = md5(strtolower(trim($email)));
$gravurl = "http://www.gravatar.com/avatar/$email?d=$default&s=60&r=$rating";
return '<img src="'.$gravurl.'" width="60" height="60" border="0" alt="Avatar">';
}
?>
@abedputra
abedputra / index.html
Created August 23, 2017 00:44
International Phone Numbers |Global Numbers
<div class="form-group">
<label for="input-4">Phone</label>
<div class="form-inline">
<div class="form-group">
<div class="input-group">
<span class="input-group-addon"><i class=
"glyphicon glyphicon-globe"></i>&nbsp;&nbsp;Country Code</span>
<select class="select-option" name="phone_code">
<option data-countrycode="GB" selected value="44">
UK (+44)