This file contains 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
alias rails_s="gnome-terminal -e 'bash -c \"rails s; bash\"'" |
This file contains 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 | |
project_name=$1 | |
if [ -z project_name ]; then | |
echo | |
echo "projects need names too, I'm sure you can think of a neat one!" | |
echo " ex: rails_composer neat_name" | |
echo | |
else |
This file contains 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
# Example: CloudFlare::connect { |connection| puts connection } | |
module CloudFlare | |
API_KEY = ENV['CLOUDFLARE_API_KEY'] | |
EMAIL = ENV['CLOUDFLARE_EMAIL'] | |
def self.connect | |
yield Connection.new(API_KEY, EMAIL) if block_given? | |
end | |
end |
This file contains 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/sh | |
# ~/bin/update | |
sudo apt-get -y update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install -f | |
sudo apt-get -y dist-upgrade | |
sudo apt-get -y autoclean | |
sudo apt-get -y autoremove | |
sudo do-release-upgrade -d |
This file contains 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
# lib/tasks/localtunnel.rake | |
namespace :localtunnel do | |
desc "Starts the LocalTunnel instace" | |
task start: :environment do | |
begin | |
if Rails.env.production? | |
raise "Trying to launch Localtunnel in production".red | |
end | |
default_subdomain = "whatever" | |
default_port = 3000 |
This file contains 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 | |
# ~/bin/sba_systems_check | |
systemctl status mysql --no-pager | |
systemctl status redis_6379 --no-pager | |
systemctl status elasticsearch --no-pager |
This file contains 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 . "$HOME/.bash_ps1" to .bashrc | |
export PS1='¯\_(ツ)_/¯\w$ ' |
This file contains 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
# config/application.rb | |
module YourApp | |
class Application < Rails::Application | |
# ... | |
# Auto load lib folder | |
config.autoload_paths << Rails.root.join('lib') | |
end | |
end |
This file contains 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/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
include Devise::Redirects | |
# Prevent CSRF attacks by raising an exception. | |
# For APIs, you may want to use :null_session instead. | |
protect_from_forgery with: :exception | |
include Locale | |
end |
This file contains 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
$.fn.dataTableExt.oApi.reload = function(options) { | |
this.fnFilter(options['search']) | |
this.fnPageChange(options['page']) | |
} |
OlderNewer