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 / .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 / visa.py
Created March 9, 2022 07:11 — forked from yaojialyu/visa.py
ais usvisa reschedule
# -*- coding: utf8 -*-
import time
import json
import random
import platform
from datetime import datetime
import requests
from selenium import webdriver
@stnc
stnc / golang_reduce_map.go
Created October 2, 2020 12:08 — forked from wuriyanto48/golang_reduce_map.go
How to Join Map In Golang (Map Union)
package main
import (
"fmt"
)
type Item struct{
Id int
Name string
Qty int
@stnc
stnc / test_a_sayer.go
Created March 4, 2020 01:15 — forked from deinspanjer/test_a_sayer.go
Example of cross-package interfaces in golang
package a
import "fmt"
type Sayer interface {
Say() string
}
type Formal struct{}
@stnc
stnc / README.md
Created December 24, 2019 04:27 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@stnc
stnc / delete_git_submodule.md
Created May 24, 2019 00:12 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@stnc
stnc / mask.js
Created December 11, 2018 00:04 — forked from cagartner/mask.js
Igor Escobar Jquery Input Mask 11 digitos telefones
var maskBehavior = function (val) {
return val.replace(/\D/g, '').length === 11 ? '(00) 00000-0000' : '(00) 0000-00009';
},
options = {onKeyPress: function(val, e, field, options) {
field.mask(maskBehavior.apply({}, arguments), options);
}
};
$('.phone').mask(maskBehavior, options);
@stnc
stnc / gulpfile.js
Created December 11, 2018 00:04 — forked from cagartner/gulpfile.js
Magento 2 Minification Gulp Script
var gulp = require('gulp');
var cleanCSS = require('gulp-clean-css');
var minify = require('gulp-minify');
gulp.task('default', [
'css',
'requireJsMinify',
'jsMinify'