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/env sh | |
echo Checking if the service port is available | |
until nc -z <service> <port>; do | |
printf '.' | |
sleep 5 | |
done | |
echo Service available starting app | |
exec $@ |
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/env bash | |
if [ -z "$1" ]; then | |
echo "Missing container name parameter" | |
echo " Using:" | |
echo " poke <running_container_name>" | |
exit(1) | |
fi | |
CONTAINER_NAME=$1 |
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/env sh | |
# Everytime that you save your code _Autotest_ run the tests for you | |
# MAC VERSION - needs fswatch | |
# by Alexandre Prates <ajfprates@gmail.com> | |
# mar/2018 | |
# set -x | |
if [ -z "$1" ]; then |
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
{"configs": | |
[ | |
{"filename": "./foo.conf", "content": "FOO=bar"} | |
] | |
} |
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 | |
tempfile="/tmp/$(date +%s).html" | |
cat <<EOS > $tempfile | |
<html> | |
<head><meta charset="UTF-8"><title>Youtube Pop-up</title></head> | |
<body><iframe width="640" height="360" src="$1" frameborder="0" allowfullscreen></iframe></body> | |
</html> | |
EOS |
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
require 'gosu' | |
class Map | |
FLOOR_PERCENT = 55 | |
attr_reader :content, :width, :height | |
def initialize(width, height, random = Random.new) | |
@width = width | |
@height = height |
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
require 'digest/sha2' | |
class User < ActiveRecord::Base | |
cattr_accessor :current | |
attr_accessor :password, :accept_terms | |
class << self | |
def authenticate(authentication_hash = {}) | |
user = User.find_by_email(authentication_hash[:email]) | |
user if user and user.password_match?(authentication_hash[:password]) |
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/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'yaml' | |
def http_get(url) | |
url = URI.parse url | |
response = Net::HTTP.get_response(url) | |
case response.code |
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
# Theme by ajfprates at gmail dot com | |
local current_dir='${PWD/#$HOME/~}' | |
local git_info='$(git_prompt_info)' | |
local ruby_env=' $(ruby -v | cut -d " " -f 2)' | |
PROMPT="%{$FG[040]%}%n%{$reset_color%} %{$FG[239]%}at%{$reset_color%} %{$FG[033]%}$(hostname)%{$reset_color%} %{$FG[239]%}in%{$reset_color%} %{$terminfo[bold]$FG[226]%}${current_dir}%{$reset_color%}${git_info} %{$FG[239]%}with ruby%{$fg[red]%}${ruby_env}%{$reset_color%} | |
>: " | |
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$FG[239]%}on%{$reset_color%} %{$fg[255]%}" |
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
require: | |
- rubocop-rspec | |
Style/AlignHash: | |
EnforcedHashRocketStyle: table | |
EnforcedColonStyle: table | |
Style/AlignParameters: | |
EnforcedStyle: with_first_parameter |