Skip to content

Instantly share code, notes, and snippets.

function getArticleById() {
return new Promise(function(resolve, reject) {
// Ambil nilai query parameter (?id=)
var urlParams = new URLSearchParams(window.location.search);
var idParam = urlParams.get("id");
if ('caches' in window) {
caches.match(base_url + "article/"+idParam).then(function(response) {
if (response) {
response.json().then(function (data) {
@amyunus
amyunus / main.vba
Last active August 29, 2015 14:15
Reverse Engineering: Toshl
'----- ----- ----- ----- ----- ----- ----- -----
'
' Main function
'
'----- ----- ----- ----- ----- ----- ----- -----
Sub main()
' Set range
Set planDate = Sheets("Plan").Range("A2", "A32768")
Set planCategory = Sheets("Plan").Range("B2", "B32768")
@amyunus
amyunus / gist:4705589
Created February 4, 2013 08:18
Radio Embed Code
<embed src="http://stream.suararadio.com:8000/yogyakarta_istakalisa_stereo" type="application/x-mplayer2" width="220" height="50" autostart="0" align="center" border="0" transparentatstart="0" animationatstart="1" showcontrols="true" showaudiocontrols="1" showpositioncontrols="0" showtracker="0" autosize="0" showstatusbar="1" displaysize="false" /></embed>
@amyunus
amyunus / navbar-bootstrap.css
Created November 18, 2012 05:07
navbar-bootstrap.css
.navbar-inner {
}
.brand,
.nav > li > a {
}
.brand:hover,
.nav > li > a:hover {
}
.nav > li > a:focus,
.nav > li > a:hover {
@amyunus
amyunus / wpbootstrap_scripts_with_jquery.php
Created November 16, 2012 03:30
Register and enqueue script in WordPress
<?php
function enqueue_script_in_wordpress()
{
wp_register_script( 'first-script', '/to/the/file' );
wp_register_script( 'second-script', '/to/another/file' );
// not like this
// wp_register_script( 'custom-script', '/to/the/file' );
// wp_register_script( 'custom-script', '/to/another/file' );
}
@amyunus
amyunus / httpd.conf
Created October 8, 2012 03:27
.htaccess is not working?
#perhaps your htaccess file is not being read by apache. how could?!
#yes, if your httpd.conf show this
#<Directory "/var/www/html">
# Options Indexes Includes FollowSymLinks
# AllowOverride None
# Allow from all
# Order allow,deny
#</Directory>