Skip to content

Instantly share code, notes, and snippets.

View natanshalva's full-sized avatar

Natan Shalva natanshalva

  • Berlin
View GitHub Profile
@lukecav
lukecav / ngnix.config
Last active May 14, 2023 13:46
Browser caching rules for NGNIX and expire headers.
# Browser caching of static assets.
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
expires 7d;
add_header Cache-Control "public, no-transform";
}
# Media: images, icons, video, audio send expires headers
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$ {
expires 1M;
access_log off;
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@nealrs
nealrs / contractions.py
Created May 31, 2015 01:33
Expand common (and some very uncommon) english contractions
"""
this code is not mine! i shamelessly copied it from http://stackoverflow.com/questions/19790188/expanding-english-language-contractions-in-python
all credits go to alko and arturomp @ stack overflow.
basically, it's a big find/replace.
"""
import re
cList = {
"ain't": "am not",
@Akira-Hayasaka
Akira-Hayasaka / gist:dd204bca6ce906113cfa
Created April 3, 2015 22:33
refresh git cash for .gitignore
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
git push origin master
@rufhausen
rufhausen / Push.php
Last active August 10, 2021 08:13
Laravel Artisan command for pushing to remotes via git
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
class Push extends Command {
/**
* The console command name.
@joaocunha
joaocunha / sublime-text-paste-indent-shortcut.json
Last active December 28, 2015 16:09
Sublime Text Paste & Indent Shortcut
// Replaces pasting with paste and indent.
// Add to [Preferences → Key Bindings - User] file
// MAC
{ "keys": ["super+v"], "command": "paste_and_indent"},
{ "keys": ["super+shift+v"], "command": "paste" }
// Windows/Linux
{ "keys": ["ctrl+v"], "command": "paste_and_indent"},
{ "keys": ["ctrl+shift+v"], "command": "paste" }
@JeffreyWay
JeffreyWay / .bash_profile
Created May 8, 2013 18:02
Laravel aliases
# laravel new-app
alias laravel="git clone -o laravel -b develop https://github.com/laravel/laravel.git"
alias artisan="php artisan"
alias migrate="php artisan migrate"
alias serve="php artisan serve"
alias dump="php artisan dump"
alias t="phpunit"
# Generators Package