Skip to content

Instantly share code, notes, and snippets.

View sonyarianto's full-sized avatar
🙏
Keep learning, stay relevant, relevancy increases value.

Sony AK sonyarianto

🙏
Keep learning, stay relevant, relevancy increases value.
View GitHub Profile
@sonyarianto
sonyarianto / template-html-5.go
Last active December 8, 2018 03:52
Go template code - loop data on template
package main
import (
"github.com/julienschmidt/httprouter"
"html/template"
"log"
"net/http"
)
func Home(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
@sonyarianto
sonyarianto / web-routing-httprouter-mux.go
Last active December 8, 2018 04:39
Web routing with httprouter mux
package main
import (
"fmt"
"github.com/julienschmidt/httprouter"
"log"
"net/http"
)
func HomeHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
@sonyarianto
sonyarianto / read_shoutcast_icecast_metadata.php
Created December 27, 2020 08:35
Read Shoutcast or Icecast Stream Metadata
<?php
function getStreamMetadata($streamUrl) {
$needle = 'StreamTitle=';
$ua = 'Dailymate Radio/1.0';
$opts = ['http' => ['method' => 'GET',
'header' => 'Icy-MetaData: 1',
'user_agent' => $ua]
];
@sonyarianto
sonyarianto / index.js
Created September 14, 2023 13:57
Hello world!
console.log("Hello world!");