I hereby claim:
- I am aseroff on github.
- I am aseroff (https://keybase.io/aseroff) on keybase.
- I have a public key whose fingerprint is CFE3 14CB 180E A640 BAF7 9ACC CBD2 671B 9D67 371F
To claim this, I am signing this object:
# Access number | |
cat production.log | grep "^Processing" | wc | awk '{print $1}' | |
# Each IP access number | |
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq -c | |
# Independent IP number | |
cat production.log | grep "^Processing" | awk '{print $4}' | uniq | wc | awk '{print $1}' | |
cat production.log | grep “^Processing” | awk ‘{print $4}’ | uniq | wc -l |
ls -ls | wc -l |
I hereby claim:
To claim this, I am signing this object:
class Something < ActiveRecrd::Base | |
scope :for_ids_with_order, ->(ids) { | |
order = sanitize_sql_array( | |
["position(id::text in ?)", ids.join(',')] | |
) | |
where(:id => ids).order(order) | |
} | |
end |
def marc_record(textbook) | |
# Generate a MARC record with a leader | |
record = MARC::Record.new() | |
# Leader example: | |
# *00-04 Record length computed automatically | |
record.leader[5] = "n" | |
record.leader[6] = "a" | |
record.leader[7] = "i" | |
record.leader[9] = "a" |
/* | |
-How to use Custom CSS for the Gamepad Viewer- | |
http://mrmcpowned.com/gamepad | |
Enabling a custom CSS is as easy as adding &css=[url to css file] | |
to the end of the url like so: | |
http://mrmcpowned.com/gamepad?p=1&css=https://gist.github.com/anonymous/526491dc02014099cd14/raw/d7bb0477ba984f794497f3f0f82cb33484dc7889/ps3.css | |
If you're going to be using custom CSS for the gamepad viewer | |
to design your own skin, we're assuming you have some sort of |
So you're running a Rails application and want to spruce up your YARD documentation. Here's the guide I wish I had.
Add yard-activerecord
and yard-activesupport-concern
to your Gemfile, add --plugin activerecord
and --plugin activesupport-concern
to your .yardopts
flags, and db/schema.rb
to the end of your .yardopts
sources. Your models' attributes and assocations should now be included in the documentation.
To modify your YARD template, create doc-src/templates/default/fulldoc/html
, then add --template-path doc-src/templates
to your project's .yardopts
. You can now create a doc-src/templates/default/fulldoc/html/css/common.css
and the styles will be included (but overwrites need to be !important
).
For a while, my org was using Wordpress to manage a public-facing website, which was reverse-proxied on my Rails application's server to share its DNS (a fairly common setup). However, the cost of supporting Wordpress and the proxy became too great to justify, and we looked into replacing Wordpress with another CMS option. I came across SpinaCMS, an open-source, Rails-powered CMS, which offered a lot of upside to proxying to a seperate server running a separate application. However, there were several gotchas that took some navigating, that I want to share in one place, considering I believe these would all be common situations to anyone trying to accomplish a similar goal. This guide will assume you have completed the basic setup of gem installation and setup rake tasks.
If your application is already running on MySQL, you probably don't want to go through the hurdles of moving to a Postgres database. Fortunately, unless you are using the e-commer
# Based on this code: https://github.com/hotwired/turbo-rails/blob/main/app/controllers/turbo/frames/frame_request.rb | |
# the response of turbo_frame_request? is based on the presence of a header named "Turbo-Frame". | |
# Therefore, you can exercise code behind this conditional in your controller tests by specifying that header in your GET requests. | |
# example controller action | |
class DashboardController < ApplicationController | |
# GET dashboard | |
def index | |
if turbo_frame_request? | |
# frame loading behavior |
Options 1-4 seen here
<%= f.select :ancestry, [['- New Primary Category -', '/']] + Category.all.map{ |category| [category.name, "#{category.ancestry}#{category.id}/"] } %>