Skip to content

Instantly share code, notes, and snippets.

@sunuazizrahayu
sunuazizrahayu / .htaccess
Created January 18, 2019 23:53
Force https://www on Codeigniter with .htaccess
RewriteEngine on
#Force WWW
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
@sunuazizrahayu
sunuazizrahayu / main.go
Created August 25, 2020 04:22 — forked from nmerouze/main.go
JSON-API with Go and MongoDB: Final Part
package main
import (
"encoding/json"
"log"
"net/http"
"reflect"
"time"
"github.com/gorilla/context"
@sunuazizrahayu
sunuazizrahayu / gist:3c89a8f6085c3c8f10e53dc3f88e887b
Created February 14, 2022 08:57 — forked from benshimmin/gist:4088493
Scale to fit and centre-align an image with FPDF
<?php
/* Caveat: I'm not a PHP programmer, so this may or may
* not be the most idiomatic code...
*
* FPDF is a free PHP library for creating PDFs:
* http://www.fpdf.org/
*/
require("fpdf.php");
class PDF extends FPDF {
@sunuazizrahayu
sunuazizrahayu / default
Created July 4, 2023 00:16
NGINX/1.22.x Default Config Debian 12
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.