I hereby claim:
- I am HotFusionMan on github.
- I am hotfusionman (https://keybase.io/hotfusionman) on keybase.
- I have a public key whose fingerprint is 89E6 CD10 2DA8 477B 4251 239D C461 8511 AC18 3574
To claim this, I am signing this object:
| #!/bin/bash | |
| # From https://www.networkworld.com/article/3620895/what-asking-which-whereis-or-whatis-can-tell-you-about-linux-commands.html , with syntax corrections for macOS X. | |
| clear | |
| if [ $# == 0 ]; then # if no arguments provided, prompt user | |
| echo -n "What command(s) are you asking about?> " | |
| read args | |
| else | |
| args=$* |
| # frozen_string_literal: true | |
| # This technique learned from https://www.eliotsykes.com/test-rails-rake-tasks-with-rspec . | |
| require 'rake' | |
| require 'active_support/concern' | |
| module TaskExampleGroup | |
| extend ActiveSupport::Concern |
| json.cache! @available_internal_employees do | |
| json.available_internal_employees do | |
| json.cache_collection! @available_internal_employees, as: :available_internal_employees do |internal_employees| | |
| json.partial! 'agent_dashboard/internal_employee', internal_employee: internal_employees | |
| end | |
| end | |
| end |
| #!/bin/bash | |
| USER=${1:-sebble} | |
| STARS=$(curl -sI https://api.github.com/users/$USER/starred?per_page=1|egrep '^Link'|egrep -o 'page=[0-9]+'|tail -1|cut -c6-) | |
| PAGES=$(($STARS/100+1)) | |
| echo You have $STARS starred repositories. | |
| echo |
I hereby claim:
To claim this, I am signing this object:
| sudo /usr/lib/update-notifier/apt-check --human-readable |
| CREATE OR REPLACE FUNCTION XOR(boolean, boolean) RETURNS boolean as $$ BEGIN RETURN ($1 and not $2) OR (not $1 and $2); END; $$ LANGUAGE 'plpgsql'; |
| # Thanks to https://stackoverflow.com/questions/7051062/whats-the-best-way-to-include-a-like-clause-in-a-rails-query for the original code. | |
| module ActiveRecord | |
| module Querying | |
| def match_scope_condition(column, query) | |
| arel_table[column].matches("%#{query}%") | |
| end | |
| def matching(*args) | |
| column_name, opts = args.shift, args.extract_options! | |
| operator = opts[:operator] || :or |
| # For inclusion into a Rails config/initializers/better_errors.rb file. | |
| if defined?(BetterErrors) | |
| if ENV['DEV_PROFILING'] == 'true' || ENV['DEV_DISABLE_ERRORS'] == 'true' | |
| Rails.configuration.middleware.delete( BetterErrors::Middleware ) | |
| end | |
| BETTER_ERRORS_EDITORS = { 'x-mine:' => "x-mine://open?file=%{file}&line=%{line}", 'sublime:' => :sublime, 'txmt:' => :textmate, 'emacs:' => :emacs, 'mvim:' => :macvim } | |
| if RUBY_PLATFORM.index( 'darwin' ) | |
| unless ENV['BETTER_ERRORS_EDITOR'].blank? |
| include ActionView::Helpers | |
| haml_code = File.open( 'path/to/haml/file' ) { |file| file.read } | |
| engine = Haml::Engine.new( haml_code ) | |
| puts engine.render |