Skip to content

Instantly share code, notes, and snippets.

View TuralAsgar's full-sized avatar

Tural Asgarov TuralAsgar

View GitHub Profile
@Pen-y-Fan
Pen-y-Fan / Info for PHPStorm.md
Last active July 21, 2024 12:12
PHPStorm Tips, Tricks and setup

PHPStorm

PhpStorm Tips, ticks and standard setup

  1. Tips and Tracks for PHPStorm (PHPStorm Tips and Tricks.md)
  2. Standard setup for PHP projects (Standard.md)
@justsml
justsml / fetch-api-examples.md
Last active April 22, 2025 13:44
JavaScript Fetch API Examples
@ale10257
ale10257 / menu.php
Last active August 31, 2020 11:57
Yii2 displaying a menu with an unlimited nesting level from Nested Sets
<?php
/**
* @var $this yii\web\View
* @var $categories \app\models\Category[]
* @var $level_start int
*/
use yii\helpers\Html;
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active June 16, 2025 14:26
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

[Unit]
Description=ServiceName
Documentation=https://example.com/doc.txt
After=network-online.target
Wants=network-online.target systemd-networkd-wait-online.service
[Service]
Restart=on-failure
PermissionsStartOnly=true
User=programusername
@ishanjain28
ishanjain28 / nginx
Last active September 5, 2017 22:13
# nginx reverse proxy configuration for hosting two websites on one server
# File has to be saved in /etc/nginx/sites-available/website
# Then link it and store that in ../sites-enabled
# Also this configuration can be used to enable https on a website, Remove the third server {} block.
server {
# Redirect from http to https
listen 80;
listen [::]:80 default_server;
return 301 https://$host$request_uri;
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@tanyuan
tanyuan / smart-caps-lock.md
Last active June 23, 2025 04:44
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@albulescu
albulescu / download.go
Created March 25, 2016 09:44
golang download file with progress
package main
/**
* @website http://albulescu.ro
* @author Cosmin Albulescu <[email protected]>
*/
import (
"bytes"
"fmt"
@tabula-rasa
tabula-rasa / ckupload.go
Created November 20, 2015 19:25
Golang handler for Ckeditor image upload
package controllers
import (
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
"path/filepath"