Skip to content

Instantly share code, notes, and snippets.

View ericariyanto's full-sized avatar
🏠
Working from home

Eric Ariyanto ericariyanto

🏠
Working from home
View GitHub Profile
@ericariyanto
ericariyanto / maps.php
Created June 20, 2021 08:13
Show Latlng in Google Maps Embed
<?php
function show_maps_embed($params = array())
{
$params['width'] = @$params['width'] ?: '100%';
$params['height'] = @$params['height'] ?: '350px;';
$url = "https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d997.4542966610668!2d" . @$params['lng'] . "!3d" . @$params['lat'] . "!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zMMKwMDInMzUuNSJTIDEwOcKwMTknNDAuMyJF!5e0!3m2!1sid!2sid!4v1592115157334!5m2!1sid!2sid";
$html = '<iframe src="' . $url . '" width="' . @$params['width'] . '" height="' . @$params['height'] . '" frameborder="0" style="border:0; width:' . @$params['width'] . '; height: ' . @$params['height'] . '; ' . @$params['style'] . '" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>';
return $html;
@ericariyanto
ericariyanto / LocationTrackingService.kt
Created September 12, 2017 13:57 — forked from gentra/LocationTrackingService.kt
Android Location Tracking Service in Kotlin language. Referenced from: http://stackoverflow.com/a/28535885/1441324
import android.app.Service
import android.content.Context
import android.content.Intent
import android.location.Location
import android.location.LocationManager
import android.os.Bundle
import android.util.Log
class LocationTrackingService : Service() {
@ericariyanto
ericariyanto / README.md
Created September 26, 2016 06:42 — forked from debashisbarman/README.md
A Twitter bot that can retweet in response to the tweets matching particluar keyword (https://goo.gl/4whEIt)

#Creating a Twitter bot with Node.js Learn how you can create your own Twitter bot using Node.js and the new Twitter API. The bot will auto retweet in response to tweets with some particular hashtags. (https://goo.gl/4whEIt)

##Tools we need Here are the tools we’ll be using to create the bot — 

  • Node.js installed in your machine
  • A registered Twitter account

Create a Twitter application

@ericariyanto
ericariyanto / available_font-awesome_icons.php
Created August 24, 2016 07:29 — forked from gubi/available_font-awesome_icons.php
Get all icons from a font-awesome.css file and list in json mode
<?php
/**
* Available Font Awesome icons
*
* Get all icons from a font-awesome.css file and list in json mode
*
* @author Alessandro Gubitosi <[email protected]>
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3
*/
@ericariyanto
ericariyanto / index.html
Created September 29, 2015 04:32 — forked from johnschimmel/index.html
Demo of loading Google Maps, fetching Markers with AJAX, Geocoding new location and POSTing new location with AJAX. http://dwd-nodejs-remoteapis.herokuapp.com/
<style>
/* IMPORTANT - must give map div height */
#map-canvas {
height:400px;
}
/* IMPORTANT - fixes webkit infoWindow rendering */
#map-canvas img {
max-width: none;
}
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@ericariyanto
ericariyanto / 0_reuse_code.js
Created December 23, 2013 09:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console