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
alias ll='ls -l' | |
alias la='ls -la' | |
alias lls='ls -lShr' | |
alias llt='ls -ltr' | |
alias cat='bat' | |
alias less='bat' | |
alias ni='npm install' | |
alias rebundle='bundle && bundle clean --force && bundle pristine && echo "Rebundled!' |
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
# Source: BOM Climate Data Online: http://www.bom.gov.au/climate/data/index.shtml | |
# Values taken for a weather station in the capital city of each state | |
climate = { | |
'ACT': { | |
'temp_max': [28.5, 28.1, 24.7, 20.1, 15.8, 12.3, 11.5, 13.5, 16.2, 19.6, 23.5, 26.3], | |
'temp_min': [13.6, 13.8, 11.5, 7.0, 4.2, 1.4, 0.0, 1.3, 4.0, 6.7, 9.7, 11.9], | |
'wind_morning': [5.4, 5.0, 5.8, 5.0, 5.1, 5.7, 5.2, 5.9, 7.8, 8.1, 6.2, 6.6], | |
'wind_afternoon': [11.9, 10.8, 10.6, 9.8, 9.6, 9.7, 11.1, 12.4, 13.3, 13.5, 12.3, 12.8], | |
}, | |
'NSW': { |
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
-- For more see: https://www.compose.com/articles/cross-database-querying-in-compose-postgresql/ | |
-- From client database | |
CREATE EXTENSION postgres_fdw; | |
CREATE SERVER my_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'localhost', dbname 'other_db_name', port '5432'); | |
CREATE USER MAPPING FOR my_user SERVER my_server OPTIONS (user 'my_user'); | |
CREATE SCHEMA my_foreign_schema; |
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 | |
set -e | |
START_COMMIT=abcdef123 | |
COMMITS=$(git log --format="%H %ad" --merges $START_COMMIT...) | |
while read -r LINE; do | |
COMMIT=$(echo $LINE |cut -d ' ' -f 1) | |
DATE=$(echo $LINE |cut -d ' ' -f 2-) |
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
stty -F /dev/ttyACM0 0:0:8bd:0:3:1c:7f:8:1:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 |
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
--- a/app/assets/javascripts/store/all.js | |
+++ b/app/assets/javascripts/store/all.js | |
@@ -6,8 +6,7 @@ | |
// | |
//= require 'jquery' | |
-//= require store/spree_core | |
+//= require store/spree_frontend | |
//= require store/spree_auth | |
-//= require store/spree_promo |
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
# Patch for ransack (https://github.com/ernie/ransack) to use scopes | |
# Helps migrating from Searchlogic or MetaSearch | |
# Place this file into config/initializer/ransack.rb of your Rails 3.2 project | |
# | |
# Usage: | |
# class Debt < ActiveRecord::Base | |
# scope_ransackable :overdue | |
# scope :overdue, lambda { where(["status = 'open' AND due_date < ?", Date.today]) } | |
# 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
desc "Generate static error page HTML" | |
task :generate_error_pages => :environment do | |
av = ActionView::Base.new(Rails::Configuration.new.view_path) | |
av.class_eval do | |
include Rails.application.routes.url_helpers # brings ActionDispatch::Routing::UrlFor | |
include ActionView::Helpers::TagHelper | |
include LayoutHelper | |
def cache(name = {}, options = nil, &block) | |
yield |
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
<!-- register_email.text.erb --> | |
Dear <%= @user.name || @user.user %>, | |
Thank you for registering with ASSDA's online Nesstar facility. | |
Your username and password are: | |
Username: <%= @user.user %> | |
Password: <%= @password %> |