Skip to content

Instantly share code, notes, and snippets.

View idhamperdameian's full-sized avatar
🐱
I may be slow to respond.

Ivo Idham Perdameian idhamperdameian

🐱
I may be slow to respond.
View GitHub Profile
@idhamperdameian
idhamperdameian / ProxyUtils.java
Last active October 15, 2020 00:37 — forked from mcxiaoke/ProxyUtils.java
set proxy for Android WebView, worked on api 9 ~ 19
package com.mcxiaoke.next.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.net.Proxy;
import android.os.Build;
import android.os.Parcelable;
import android.util.ArrayMap;
import android.util.Log;
@idhamperdameian
idhamperdameian / config.cson
Last active February 28, 2017 03:37
Atom config file
"*":
"atom-beautify":
general:
_analyticsUserId: "d26cbeab-350e-4484-846c-eaa1f9a26a0d"
"autocomplete-php":
executablePath: "/usr/local/bin/php"
autosave:
enabled: true
core:
disabledPackages: [
@idhamperdameian
idhamperdameian / file_get_contents.php
Created October 5, 2016 04:53
Download using php file_get_contents
<?php
$opts = array(
'http'=>array(
'method'=> "GET",
'header'=> "Accept:*/*\r\n
Accept-Encoding:gzip, deflate, sdch\r\n
Accept-Language:en-US,en;q=0.8,id;q=0.6\r\n
Cache-Control:no-cache\r\n
Connection:keep-alive\r\n
Host:www.ligascore.com
<?php
$options = array(
CURLOPT_URL => 'https://www.google.co.id',
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_HEADER => 0,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_ENCODING => "",
CURLOPT_AUTOREFERER => 1,
CURLOPT_CONNECTTIMEOUT => 120,
//CURLOPT_TIMEOUT => 120,
@idhamperdameian
idhamperdameian / Laravel PHP7 LEMP AWS.md
Created August 30, 2016 10:08 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 14.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 14.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
[
{"id":1,"name":"name 1","description":"description 1","field3":"field3 1","field4":"field4 1","field5 ":"field5 1"},
{"id":2,"name":"name 2","description":"description 1","field3":"field3 2","field4":"field4 2","field5 ":"field5 2"},
{"id":3,"name":"name 3","description":"description 1","field3":"field3 3","field4":"field4 3","field5 ":"field5 3"}
]
@idhamperdameian
idhamperdameian / README.md
Last active August 29, 2015 14:14
Strip Trailing Whitespace in Xcode 4+

How to use

By default Xcode not remove trailing whitespace from code, this gist will do it to you.

Copy remove-whitespaces.sh anywere you like in your Mac, and be sure to give it the execute permission. Open XCode preferences go to behaviors:

alt text

@idhamperdameian
idhamperdameian / time_increment.php
Created October 10, 2014 03:53
Loop for time incremented by 15 minutes
<?php
$start=strtotime('00:00');
$end=strtotime('23:30');
for ($i=$start;$i<=$end;$i = $i + 15*60)
{
echo date('H:i A',$i).'<br>';
}
?>