Skip to content

Instantly share code, notes, and snippets.

@sokil
sokil / datetime.md
Last active November 5, 2024 16:01
date time and timestamp in MySQL

Difference

MySQL converts TIMESTAMP values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. This does not occur for other types such as DATETIME.

if server timezone changed, values of timestamp will be valid, because it stored as UTC, but values of datetime will change.

Timestamp

Timestamp stores values from 1970-01-01 00:00:00 UTC.

@ajeetraina
ajeetraina / docker-compose.yml
Created October 29, 2017 12:21
Docker Compose File for MacVLAN Network Driver ( Single Node)
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
networks:
- myvlan
@bsara
bsara / git-ssh-auth-win-setup.md
Last active February 6, 2026 09:37
Setup SSH Authentication for Git Bash on Windows

Setup SSH Authentication for Git Bash on Windows

Prepararation

  1. Create a folder at the root of your user home folder (Example: C:/Users/uname/) called .ssh.
  2. Create the following files if they do not already exist (paths begin from the root of your user home folder):
  • .ssh/config
@rmrhz
rmrhz / labs.dev.conf
Created June 15, 2016 03:34
Wildcard subdomain + directory Nginx setup
server {
listen 80;
server_name ~^(?<subdomain>.*)\.labs.dev$;
root "/srv/labs/$subdomain/public";
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}

The Laracasts PHPStorm theme - modified.

This is a slightly modified version of the great Laracasts PHPStorm theme. I've added some styles for Verions Control (add, modified, deleted line...) and fixed some missing things like warnings.

Download

image

Mac: Add to ~/Library/Preferences/WebIde80/colors

@roundand
roundand / OpenWithSublimeText3.bat
Last active February 12, 2026 13:15 — forked from mrchief/LICENSE.md
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@fajrif
fajrif / gist:1265203
Created October 5, 2011 18:12
git clone specific tag
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master