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
# Copy this into your `~/.profile`. | |
# This setup an incredibly ugly hack that recompiles your `PATH` | |
# everytime the prompt is printed. | |
# I need this to inject the nearest `node_modules/.bin` into my | |
# path to make it easy to use the binarys there. | |
# Your normal PATH exports here | |
export PATH=$HOME/bin:$PATH | |
ORIGINAL_PATH=$PATH |
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
class ApplicationController < ActionController::Base | |
... | |
#Problem: | |
#In rails 3.0.1+ it is no longer possible to do this anymore; | |
# rescue_from ActionController::RoutingError, :with => :render_not_found | |
# | |
#The ActionController::RoutingError thrown is not caught by rescue_from. | |
#The alternative is to to set a catch-all route to catch all unmatched routes and send them to a method which renders an error | |
#As in http://techoctave.com/c7/posts/36-rails-3-0-rescue-from-routing-error-solution |
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
# add this to your ~/.bash_profile to get a bash prompt like | |
# ~/your-path (git-branch-name) /dockerMachineName/ $ | |
function color_my_prompt { | |
local __user_and_host="\[\033[01;32m\]\u@\h" | |
local __cur_location="\[\033[01;34m\]\w" | |
local __git_branch_color="\[\033[31m\]" | |
local __git_branch='`command git branch 2> /dev/null | /usr/bin/grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\ /`' | |
local __docker_machine_name_color="\[\033[36m\]" | |
local __docker_machine_name='`if [ $DOCKER_MACHINE_NAME ]; then echo "/$DOCKER_MACHINE_NAME/ "; fi`' |
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
<!DOCTYPE html> | |
<script src="url.js"></script> | |
<script> | |
var url = new URL('http://www.example.com/a/b/c.html?p=q&r=s&p&p=t#hash'); | |
for (var key in url) { | |
console.log(key, url[key]); | |
} |
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
FROM php:7.0-apache | |
RUN apt-get update \ | |
&& apt-get install -y curl vim \ | |
&& a2enmod rewrite | |
# Statamic requires GD and Exif | |
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev | |
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ |
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
" ----------------------------------------------------------------------------- | |
" Extended behavior on top of https://github.com/zivyangll/git-blame.vim | |
" An attempt to see if re-mapping j/k to invoke :GitBlame is a useful feature | |
function! IsGitControlled() | |
let l:filepath = expand('%:p') | |
let l:git_root = system('git rev-parse --show-toplevel 2>/dev/null') | |
" If the file is under git control | |
if v:shell_error == 0 && !empty(l:git_root) | |
return 1 |
OlderNewer