Skip to content

Instantly share code, notes, and snippets.

View silalahi's full-sized avatar
🎯
Focusing

Jogi Silalahi silalahi

🎯
Focusing
View GitHub Profile
{
"data": [
{
"code": "11",
"name": "Aceh",
"coordinates": {
"lat": "4.695135",
"lng": "96.7493993"
},
"google_place_id": "ChIJvcR8UN-bOTARYMogsoCdAwE"
<?php
/**
* Daily Coding Problem:
*
* Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
* For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17.
*/
function possible($numbers = [], $k) {
@silalahi
silalahi / gcm.php
Created July 4, 2012 08:04
GCM Push Notification PHP
<?php
// GCM Server URL
$url = 'https://android.googleapis.com/gcm/send';
// Server API
// Didapat dari Google Console
$serverApiKey = "API KEY";
// Device ID
// Didapat dari device
@silalahi
silalahi / server.php
Created July 3, 2012 12:15
GCM PHP Source COde
<?php
// GCM Server URL
$url = 'https://android.googleapis.com/gcm/send';
// Server API
// Didapat dari Google Console
$serverApiKey = "YOUR SERVER API KEY";
// Device ID
// Didapat dari device
@silalahi
silalahi / index.php
Created February 13, 2012 19:00
Wrapper Class IMDb API PHP
<?php
// Dont forget to include class
require_once(dirname(__FILE__) . '/libraries/imdb.php');
// Instance
$imdb = new imdb();
// Search
$imdb->search('shawshank redemption');
@silalahi
silalahi / imdb.php
Created February 13, 2012 18:59
IMDb Wrapper Class PHP
<?php
/**
* IMDB Wrapper API
* Wrapper class to retrieve data from IMDB
* http://jogisilalahi.com/blog/imdb-api-wrapper-class-php
* @author Jogi Silalahi <silalahi.jogi@gmail.com>
*/
class IMDB