Skip to content

Instantly share code, notes, and snippets.

View stefan-vatov's full-sized avatar
🦀
rock on

Stefan Vatov stefan-vatov

🦀
rock on
View GitHub Profile
@stefan-vatov
stefan-vatov / optimize.sh
Created August 21, 2017 17:52 — forked from ryansully/optimize.sh
image optimization script (pngcrush & jpegtran)
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for png in `find $1 -iname "*.png"`; do
echo "crushing $png ..."
pngcrush -rem alla -reduce -brute "$png" temp.png
@stefan-vatov
stefan-vatov / codemods.sh
Created January 10, 2017 15:21 — forked from JamieMason/codemods.sh
Run some useful codemods together in bulk **hard-coded to run against `$pwd/src/app` currently**
#!/bin/bash
function codemods() {
echo "-----"
echo "Running $1 from https://github.com/JamieMason/codemods.git"
jscodeshift -t "${TMPDIR}codemods/transforms/$1.js" "$2"
}
function js_codemod() {
echo "-----"
@stefan-vatov
stefan-vatov / post-merge.sh
Last active June 13, 2021 03:30 — forked from sindresorhus/post-merge
[Post Merge Hook]
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
#
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
#
# This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2
# minutes, and everything below /ghost/ is pass()-ed so the user sessions
# work.
#
@stefan-vatov
stefan-vatov / example
Created December 18, 2013 07:33 — forked from cedricwalter/example
Sample config for nginx when proxying through Atlassian products.
## Server configuration for nginx to host Atlassian Jira / Jetbrain TeamCity or any other Tomcat web application
#
# author cedric.walter, www.waltercedric.com
# to be saved for ex in /etc/nginx/sites-available/example
server {
listen 80;
server_name jira.example.com;
access_log off;
location / {