Skip to content

Instantly share code, notes, and snippets.

View pbrilius's full-sized avatar
🏠
Working from home

Povilas Brilius pbrilius

🏠
Working from home
View GitHub Profile
@pbrilius
pbrilius / pre-commit
Created November 9, 2018 00:07 — forked from fdemiramon/pre-commit
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
#!/bin/sh
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
then
oIFS=$IFS
IFS='
@pbrilius
pbrilius / gist:5ba36b97e0c76b8bb95206c9580ea67a
Created October 15, 2016 14:54 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@pbrilius
pbrilius / mtop
Created April 5, 2016 12:35 — forked from bessangel/mtop
mtop.sh - mysql top
#!/bin/bash
if [ ! -z $1 ]; then
export MTOPU="-uroot"
export MTOPPW="-p$1"
fi
if [ -f /root/.my.cnf ]; then
MTOPU=' '
MTOPPW=' '
fi
if [ -z $MTOPU ] && [ -z $MTOPPW] && [ $MTOPU != ' ' ]; then
@pbrilius
pbrilius / cleanCache.php
Created April 1, 2016 12:07 — forked from colinmollenhour/cleanCache.php
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');
@pbrilius
pbrilius / atom-shell-arm-build.sh
Created March 29, 2016 17:51 — forked from nasser/atom-shell-arm-build.sh
Cross compile atom-shell to ARM from Ubuntu 14.04
# from https://github.com/atom/atom-shell/blob/master/docs/development/build-instructions-linux.md
# run as root on ubuntu 14.04
# basic deps
apt-get install build-essential clang libgtk2.0-dev libnotify-dev gcc-multilib g++-multilib libgnome-keyring-dev
# node
apt-get install python-software-properties software-properties-common
add-apt-repository ppa:chris-lea/node.js
apt-get update
@pbrilius
pbrilius / example.erb
Created September 27, 2015 19:20 — forked from jjulian/example.erb
Running Ruby under Apache like PHP, using cgi - http://stackoverflow.com/a/1901772/231245
<% header "Content-Type" => "text/html" %>
<h1>Let's run some ruby code: <%= rand %></h1>