Skip to content

Instantly share code, notes, and snippets.

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

Yuwono Darmawan yuwonodarmawan

🏠
Working from home
  • 06:19 (UTC +07:00)
View GitHub Profile
@yuwonodarmawan
yuwonodarmawan / grab_vimeo_thumbnail.php
Created October 28, 2021 07:40 — forked from bacoords/grab_vimeo_thumbnail.php
Grab a thumbnail of a private (but embeddable) Vimeo video
<?php
/**
* Grab the url of a publicly embeddable video hosted on vimeo
* @param str $video_url The "embed" url of a video
* @return str The url of the thumbnail, or false if there's an error
*/
function grab_vimeo_thumbnail($vimeo_url){
if( !$vimeo_url ) return false;
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) );
@yuwonodarmawan
yuwonodarmawan / api_cache.php
Created November 28, 2018 00:55 — forked from corbanb/api_cache.php
Simple API caching with PHP
<?php
/**
* API Request Caching
*
* Use server-side caching to store API request's as JSON at a set
* interval, rather than each pageload.
*
* @arg Argument description and usage info
*/
@yuwonodarmawan
yuwonodarmawan / nginx.conf
Created November 10, 2018 02:07 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@yuwonodarmawan
yuwonodarmawan / http.php
Created November 1, 2018 16:01
simple http request example in php
<?php
/*
* simple HttpRequest example using PHP
* tom slankard
*/
class HttpRequest {
public $url = null;
@yuwonodarmawan
yuwonodarmawan / extensions_override_freepbx.conf
Created July 9, 2018 02:34 — forked from rtucker/extensions_override_freepbx.conf
FreePBX/Asterisk dialplan override configuration to reroute *97 (check voicemail) for one extension
[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,GotoIf($["${AMPUSER}" = "103"]?googryan)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),MailBoxExists(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = "SUCCESS"]?mbexist)
exten => *97,n,VoiceMailMain()