This Web Components keeps the year in your copyright notice up-to-date.
export { CopyrightYearElement }
const name = "copyright-year";
class CopyrightYearElement extends HTMLSpanElement {
mv -v ~/Library/Application\ Support/.ffuserdata ~/.Trash |
#!/usr/bin/swift | |
import Foundation | |
let path = URL(fileURLWithPath: NSString(string: "~/Library/Application Support/.ffuserdata").expandingTildeInPath) | |
let data = try! NSData(contentsOf: path) as Data | |
let dictionary = try! NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) as! NSDictionary | |
let mutableDictionary = dictionary.mutableCopy() as! NSMutableDictionary | |
for (key, value) in mutableDictionary { |
FROM ruby:2.4-alpine | |
ENV PATH /root/.yarn/bin:$PATH | |
RUN apk update && apk upgrade && \ | |
apk add --no-cache bash git openssh build-base nodejs tzdata | |
RUN apk update \ | |
&& apk add curl bash binutils tar gnupg \ | |
&& rm -rf /var/cache/apk/* \ |
# Content Parner: Wellington SPCA | |
# Data Source: SPCA Wellington Flickr | |
class SPCAWellingtonFlickr < SupplejackCommon::Xml::Base | |
base_url 'https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=66881cbc6259eae63ceb6d6453159892&user_id=73889498@N04&photoset_id=72157628780736141&privacy_filter=1&extras=description,%20license,%20date_taken,%20owner_name,%20geo,%20tags,%20media,%20machine_tags,%20url_m,%20url_z,%20url_o&format=rest' | |
paginate page_parameter: 'page', type: 'page', per_page_parameter: 'per_page', per_page: 100, page: 1, total_selector: '//*[1]/@total' | |
record_selector '//photo' | |
record_format :xml | |
throttle host: 'api.flickr.com', delay: 1 |
# Original Rails controller and action | |
class EmployeesController < ApplicationController | |
def create | |
@employee = Employee.new(employee_params) | |
if @employee.save | |
redirect_to @employee, notice: "Employee #{@employee.name} created" | |
else | |
render :new | |
end |
The easiest way to load the Mysql Time Zone tables from your Mac OS time zone fields is via this command:
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
However, on many systems like mine that will fail because some of the time zone information is incompatible with the database schema for the time zone tables.
Therefore, you'll want to load the time zone information into a text file and edit it to only include the time zones you need. (Or, attempt to find the data breaking the import.)
mysql_tzinfo_to_sql /usr/share/zoneinfo > zone_import.sql
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
html = %(<div class="field_with_errors">#{html_tag}</div>).html_safe | |
# add nokogiri gem to Gemfile | |
form_fields = [ | |
'textarea', | |
'input', | |
'select' | |
] |