Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
<RoutingRules> | |
<RoutingRule> | |
<Condition> | |
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> | |
</Condition> | |
<Redirect> | |
<HostName>danilop.net</HostName> | |
<ReplaceKeyWith/> | |
</Redirect> | |
</RoutingRule> |
# Signal catching | |
def shut_down | |
puts "\nShutting down gracefully..." | |
sleep 1 | |
end | |
puts "I have PID #{Process.pid}" | |
# Trap ^C | |
Signal.trap("INT") { |
=begin | |
Easy Basic Authentication for Sinatra actions. | |
USAGE | |
require 'rubygems' | |
require 'sinatra' | |
require 'sinatra-auth' | |
#!/bin/bash | |
#============================================================================ | |
#title :vmangos.sh | |
#description :VMaNGOS deploy script for Ubuntu 16.04 | |
#author :canseco.me | |
#date :20181122 | |
#version :0.8.1 | |
#============================================================================ | |
## Utilities |
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
#ZSH_THEME="alanpeabody" | |
#ZSH_THEME="dieter" | |
#ZSH_THEME="eastwood" |
require 'sinatra' | |
require 'json' | |
require 'csv' | |
# Serve data as JSON | |
get '/hi/:name' do | |
name = params[:name] | |
content_type :json | |
{ :message => name }.to_json | |
end |
require 'openssl' | |
k = OpenSSL::PKey::EC.new('secp384r1').generate_key | |
p = OpenSSL::PKey::EC.new(k.public_key.group) | |
p.public_key = k.public_key | |
puts k.to_pem, p.to_pem |
#!/bin/sh | |
PRINT=true | |
LOGGER=false | |
warning_days=30 | |
certs_to_check='example.com:443 | |
mail.example.com:25 | |
wiki.example.org:443 | |
' |
<div class="container"> | |
<% flash.each do |type, msg| %> | |
<div class="alert <%= bootstrap_class_for_flash(type) %> alert-dismissable fade show"> | |
<%= msg %> | |
<button class="close" data-dismiss="alert">x</button> | |
</div> | |
<% end %> | |
</div> |