Skip to content

Instantly share code, notes, and snippets.

business as usual

Tadas Sasnauskas tadas-s

business as usual
Block or report user

Report or block tadas-s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
tadas-s / Vagrantfile
Created Oct 27, 2017
Installing your personal dotfiles on each Vagrant VM you use
View Vagrantfile
# Change this to suit your dotfiles setup and copy to your *HOST* machine: $HOME/.vagrant.d/Vagrantfile
Vagrant.configure(2) do |config|
# Mount your dotfiles to vagrant user's home folder (or wherever you want):
config.vm.synced_folder "#{ENV['HOME']}/dotfiles", '/home/vagrant/dotfiles'
# Install dotfiles on every 'vagrant provision' call.
# For example, let's imagine your your dotfiles have '' script:
config.vm.provision 'shell', privileged: false, inline: '/home/vagrant/dotfiles/'
tadas-s / index.html
Last active Oct 26, 2015 — forked from alexkalderimis/index.html
Custom mode RefME widget example
View index.html
<link rel="stylesheet" href="style.css" type="text/css">
<title>RefME Cite Button</title>
<script src=""></script>
<div class="col">
<div id="citation-button"></div>
View nocol
# Strips colors/escape sequences from output
# Usage: annoying-color-producing-tool | nocol
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
tadas-s / gist:c247ac75e6418871455c
Created Nov 19, 2014
AngularJS + ui-router debug snippet
View gist:c247ac75e6418871455c$rootScope) {
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {'$stateChangeStart ' + + ' => ' +;'from:');
tadas-s / debug_recipes.txt
Last active Aug 8, 2017
Debug recipes for Linux
View debug_recipes.txt
# Quick debug network traffic between nginx and php-fpm
# Got from:
# Just a flow of everything looking like a string
tcpdump -nl -w - -i eth0 -c 500 port 9090 | strings
# Request heads
sudo tcpdump -nl -w - -i eth0 -c 500 port 9090 | strings | grep -E -A5 "^(GET|PUT|POST) "
# strace processes/sub-processes
tadas-s / gist:dae6a8f506993da19993
Created Jul 7, 2014
xdebug cli script from vagrant machine
View gist:dae6a8f506993da19993
# Say project domain in PhpStorm is configured as and your VM IP is php -dxdebug.remote_autostart=1 -f ./app/console.php -- console:args --go-here
# with xdebug log (useful for troubleshooting) php -dxdebug.remote_log="./xdebug.log" -dxdebug.remote_autostart=1 -f ./app/console.php -- console:args --go-here
tadas-s / AppKernel.php
Last active Aug 29, 2015
Relocate tmp folder on Symfony2
View AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
/* ... everything else is skipped ... */
public function getCacheDir()
tadas-s /
Last active Aug 29, 2015
# Sets-up ACL for current + www-data users to allow writing to folder by both and deleting files created by each other.
# This simplifies some Symfony2 dev tasks
if [ -z "$1" ]; then
View url_helpers_in_test_patch.rb
if Rails.env.test?
module ActionDispatch
module Routing
module UrlFor
alias_method :original_url_options, :url_options
def url_options
if self.respond_to? :request
original_url_options.merge({:host =>, :port => request.port})
View output.txt
$json = array(
'values' => array(
0 => array(
'field' => 'id1',
'value' => 895
1 => array(
'field' => 'id2',
You can’t perform that action at this time.