[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Started GET "/numbers/" for 127.0.0.1 at 2019-01-19 17:25:17 +1300
[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Processing by PagesController#show as HTML
[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Parameters: {"slug"=>"numbers"}
[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Setting Load (1.4ms) SELECT "settings".* FROM "settings" WHERE "settings"."key" = $1 LIMIT $2 [["key", "footer"], ["LIMIT", 1]]
[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Page Load (11.2ms) SELECT "pages".* FROM "pages" WHERE "pages"."id" = $1 ORDER BY "pages"."order" ASC LIMIT $2 [["id", 11], ["LIMIT", 1]]
[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Page Load (3.2ms) SELECT "pages".* FROM "pages" WHERE "pages"."slug" = $1 ORDER BY "pages"."order" ASC LIMIT $2 [["slug", "numbers"], ["LIMIT", 1]]
[c23afe93-b615-4c4d-bf0a-539ea1d6928f] Rendering pages/numbers.html.haml within layouts/application
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
#!/usr/bin/env ruby | |
# Purpose: | |
# | |
# * Edits .vscode/settings.json file to set a new theme for the project. | |
# * If no arg passed then a theme is chosen randomly. | |
# * You must already have the themes installed | |
# * You should edit the list of themes to match your favourites. | |
# | |
# Installation: |
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
# common helper functions | |
def replace_line(file_path:, old_line_regex:, new_line:) | |
new_lines = File.readlines(file_path, chomp: true).map do |line| | |
if old_line_regex.match?(line) | |
new_line | |
else | |
line | |
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
4ops.packer | |
adrianhumphreys.silverstripe | |
ahmadalli.vscode-nginx-conf | |
akamud.vscode-theme-onelight | |
alefragnani.rtf | |
aliariff.vscode-erb-beautify | |
andys8.jest-snippets | |
anotherglitchinthematrix.monochrome | |
anteprimorac.html-end-tag-labels | |
arcticicestudio.nord-visual-studio-code |
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
#!/usr/bin/env ruby | |
# 1. save this somewhere on your path as 'retheme' | |
# 2. chmod u+x retheme | |
require 'json' | |
require 'fileutils' | |
THEMES = { | |
# shorthand-name => Actual theme name |
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
class ThingyExporter | |
SQL_QUERY_PATH = Rails.root.join("app/services/thingy_exporter/query.sql") | |
SQL_QUERY = File.read(SQL_QUERY_PATH) | |
HEADERS = %w[ | |
thingy_id | |
tag_id | |
thingy_filename | |
survey_question_token | |
tag_name |
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
# Be sure to restart your server when you modify this file. | |
# Define an application-wide content security policy | |
# For further information see the following documentation | |
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy | |
Rails.application.config.content_security_policy do |policy| | |
# These directives define a quite strict policy by default. You may have to | |
# loosen this policy as you add elements to the app. Some examples of common | |
# additions are shown below. |
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
class SaferRawSQL | |
TEXT_FORMAT = 0 | |
BINARY_FORMAT = 1 | |
## | |
# You must be using the PostgreSQL database to use this method because it | |
# relies on PostgreSQL features. | |
# | |
# This method returns the same results as `ActiveRecord::Base.execute` but it | |
# helps you avoid SQL injection attacks by using the PostgreSQL feature which |
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 this to your ~/.zshrc (it only works in zsh not bash AFAIK) | |
# ##################################### | |
# A fast way of chdir to a code project | |
function work { | |
cd ~/Code/repos/$1 | |
} | |
function _work() { | |
local state |
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
module Part2 | |
# 1 | |
# 2 3 4 | |
# 5 6 7 8 9 | |
# A B C | |
# D | |
class State | |
def go_u; self; end | |
def go_d; self; end | |
def go_l; self; end |
NewerOlder