This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
project_name="project-name-here" | |
project_root="${HOME}" | |
refname=${1} | |
rev=$(git rev-parse --short ${1}) | |
this_release="${project_root}/${project_name}-${rev}" | |
mkdir -p ${this_release} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
url: <%= ENV["DATABASE_URL"] %> | |
development: | |
<<: *default | |
test: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'rspec' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 'install.sh' script: | |
config.vm.provision 'shell', privileged: false, inline: '/home/vagrant/dotfiles/install.sh' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="style.css" type="text/css"> | |
<title>RefME Cite Button</title> | |
<script src="https://widget.refme-dev.com/scripts/refme-cite.js"></script> | |
</head> | |
<body> | |
<section> | |
<div class="col"> | |
<div id="citation-button"></div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.run(function($rootScope) { | |
$rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { | |
console.group('$stateChangeStart ' + fromState.name + ' => ' + toState.name); | |
console.group('from:'); | |
console.log(fromState); | |
console.log(fromParams); | |
console.groupEnd(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quick debug network traffic between nginx and php-fpm | |
# Got from: | |
# http://systembash.com/content/simple-sysadmin-trick-using-tcpdump-to-sniff-web-server-traffic/ | |
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Say project domain in PhpStorm is configured as example.org and your VM IP is xxx.xxx.xxx.yyy: | |
PHP_IDE_CONFIG=serverName=example.org php -dxdebug.remote_autostart=1 -dxdebug.remote_host=xxx.xxx.xxx.1 -f ./app/console.php -- console:args --go-here | |
# with xdebug log (useful for troubleshooting) | |
PHP_IDE_CONFIG=serverName=example.org php -dxdebug.remote_log="./xdebug.log" -dxdebug.remote_autostart=1 -dxdebug.remote_host=xxx.xxx.xxx.1 -f ./app/console.php -- console:args --go-here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
/* ... everything else is skipped ... */ | |
public function getCacheDir() |
NewerOlder