Skip to content

Instantly share code, notes, and snippets.

@mtunjic
mtunjic / install-ruby
Created March 21, 2015 10:46
setup nginx for rails
echo "Installing libs..."
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
echo "Installing rbenv..."
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
@mtunjic
mtunjic / fix-permissions
Created June 14, 2015 23:06
Securing file permissions and ownership (drupal)
#!/bin/bash
# Help menu
print_help() {
cat <<-HELP
This script is used to fix permissions of a Drupal installation
you need to provide the following arguments:
1) Path to your Drupal installation.
2) Username of the user that you want to give files/directories ownership.
3) HTTPD group name (defaults to www-data for Apache).
Usage: (sudo) bash ${0##*/} --drupal_path=PATH --drupal_user=USER --httpd_group=GROUP
@mtunjic
mtunjic / go-ide-setup.sh
Last active September 22, 2016 09:34
Install all go libs for Visual Studio Code or Sublime 3 (vscode-go plugin)
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v github.com/golang/lint/golint
go get -u -v github.com/lukehoban/go-outline
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v github.com/tpng/gopkgs
go get -u -v github.com/newhook/go-symbols
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/visualfc/gotools
@mtunjic
mtunjic / package.json
Created October 5, 2016 08:38
Starter kit for React and Redux
{
"name": "React",
"version": "1.0.0",
"description": "Starter kit for React and Redux",
"scripts": {
"prestart": "babel-node tools/startMessage.js",
"start": "npm-run-all --parallel test:watch open:src lint:watch",
"open:src": "babel-node tools/srcServer.js",
"lint": "node_modules/.bin/esw webpack.config.* src tools",
"lint:watch": "npm run lint -- --watch",
---
benchmark: false
verbose: false
update_sources: true
backtrace: true
gem: --no-ri --no-rdoc --no-document --suggestions
@mtunjic
mtunjic / psqlrc
Created March 26, 2019 16:32
psql environment
\pset null 'NULL'
\encoding latin1
\set PROMPT1 '%n@%M:%>%x %/# '
\pset pager always
\timing on
\set qstats92 '
SELECT usename, datname, left(query,100) || ''...'' As query
FROM pg_stat_activity WHERE state != ''idle'' ;
'
@mtunjic
mtunjic / .gitignore
Last active July 9, 2019 19:04
gitignore for phoenix framework
/_build
/deps
/doc
/tmp
/node_modules
/assets/node_modules
/installer/_build
/installer/tmp
@mtunjic
mtunjic / fontfix.sh
Last active July 31, 2022 16:06
VSCode - Fix for font smoothing in MacOS 10.14+
defaults write com.microsoft.VSCode CGFontRenderingFontSmoothingDisabled 0
defaults write com.microsoft.VSCode.helper CGFontRenderingFontSmoothingDisabled 0
defaults write com.microsoft.VSCode.helper.EH CGFontRenderingFontSmoothingDisabled 0
defaults write com.microsoft.VSCode.helper.NP CGFontRenderingFontSmoothingDisabled 0
@mtunjic
mtunjic / disable.sh
Last active July 6, 2025 20:40
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@mtunjic
mtunjic / .gitignore_global
Created December 2, 2020 21:04 — forked from jacobtomlinson/.gitignore_global
An example global gitignore file
# An example global gitignore file
#
# Place a copy if this at ~/.gitignore_global
# Run `git config --global core.excludesfile ~/.gitignore_global`
# Compiled source #
###################
*.com
*.class
*.dll