Skip to content

Instantly share code, notes, and snippets.

View stnc's full-sized avatar
🎯
Focusing

TUNÇ Selman stnc

🎯
Focusing
View GitHub Profile
@stnc
stnc / nginxproxy.md
Created September 19, 2023 03:35 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@stnc
stnc / 01index.php
Last active August 19, 2023 03:34
PHP capture print/require output in variable
<?php
function renderHtml($name) {
$path = $name;
if (file_exists($path) == false) {
throw new Exception('View not found in '. $path);
return false;
}
@stnc
stnc / .gitignore
Created August 6, 2023 08:17 — forked from jodosha/.gitignore
How To Test Go HTTPS services
/*.pem
@stnc
stnc / rsasign.go
Created July 16, 2023 04:27 — forked from hansstimer/rsasign.go
Go: rsa signpkcs1v15 signing
package main
import (
"bytes"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/sha512"
"fmt"
)
@stnc
stnc / datatable.go
Last active July 12, 2023 16:49
terminal datatabel application
package main
import (
"database/sql"
"fmt"
"github.com/gdamore/tcell/v2"
_ "github.com/go-sql-driver/mysql"
"github.com/rivo/tview"
"log"
"strconv"
@stnc
stnc / builder.go
Created July 11, 2023 09:45
Builder Not Working with handle Example -- but keep as an example
package main
import (
"encoding/json"
"fmt"
"log"
)
type Builder struct {
ResponseRoot
@stnc
stnc / golangMethodOutputExample.go
Created July 11, 2023 07:52
golang method and output input duck typing bla bla bla
package main
import (
"encoding/json"
"fmt"
"log"
)
// //example 1
@stnc
stnc / EmbedStruct3.go
Last active July 11, 2023 07:53
embed strcut and pointer example 3
package main
import (
"encoding/json"
"fmt"
"log"
)
type MyResponseRoot struct {
Version string `json:"version,omitempty"`
@stnc
stnc / AdvancPointer.go
Last active July 11, 2023 19:12
golang pointer example 2
package main
import (
"encoding/json"
"fmt"
"log"
)
@stnc
stnc / basic1.go
Last active September 6, 2023 04:49
golang deep pointer example
package main
import (
"fmt"
)
func increment(ptr *int) {
*ptr = *ptr + 1
}