Skip to content

Instantly share code, notes, and snippets.

@praswicaksono
praswicaksono / install_apisix.go
Created December 17, 2024 11:39
Golang create apisix container
package docker
import (
"context"
_ "embed"
"fmt"
"io"
"os"
"github.com/docker/docker/api/types/container"
FROM alpine:3.20
ARG timezone
ENV TIMEZONE=${timezone:-"Asia/Jakarta"} \
APP_ENV=prod \
SCAN_CACHEABLE=(true)
RUN wget https://dl.static-php.dev/static-php-cli/bulk/php-8.3.11-cli-linux-x86_64.tar.gz \
&& tar zxvf php-8.3.11-cli-linux-x86_64.tar.gz \
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@praswicaksono
praswicaksono / iteration-object.php
Created January 24, 2018 15:30
Iteration Object
<?php
class Pegawai
{
public $nama = 'Budi';
public $umur = 29;
}
foreach ((new Pegawai()) as $key => $value) {
@praswicaksono
praswicaksono / iteration-array.php
Last active January 24, 2018 15:16
Iteration - Array
<?php
$pegawai = [
[
'nama' => 'Joni',
'umur' => 25,
],
[
'nama' => 'Ani',
'umur' => 21,
<?php
for ($i = 0; $i < 10; $i++) {
for ($x = 0; $x < 10; $x++) {
if ($i == 0 || $i == 9) {
echo '*';
continue;
}
if ($x == 0 || $x == 9) {
<?php
class Pelanggan
{
}
class Roti
{
private $jumlah;
@praswicaksono
praswicaksono / todo.go
Created February 4, 2016 08:33
TodoApps
package main
import (
"github.com/gorilla/mux"
"net/http"
"github.com/codegangsta/negroni"
"encoding/json"
"strconv"
"time"
"gopkg.in/mgo.v2"
class Database
{
/**
* @var \PDO
*/
protected static $conn;
/**
* @return \PDO
*/
package main
import (
"fmt"
"math/rand"
"time"
)
func random(min, max int) int {
rand.Seed(time.Now().UnixNano())