Skip to content

Instantly share code, notes, and snippets.

View peteryates's full-sized avatar
🪶

Peter Yates peteryates

🪶
View GitHub Profile
@hylom
hylom / mecab.spec
Created May 9, 2013 10:53
MeCab's spec file for rpmbuild
%define name mecab
%define version 0.996
%define release el6.4
Summary: Yet Another Part-of-Speech and Morphological
Name: %{name}
Version: %{version}
Release: %{release}
Source0: https://mecab.googlecode.com/files/mecab-%{version}.tar.gz
License: GPL/LGPL/BSD
@hylom
hylom / mecab-ipadic.spec
Last active August 16, 2016 15:40
mecab-ipadic's spec file for rpmbuild
%define name mecab-ipadic
%define ver 2.7.0
%define date 20070801
%define release el6.4_1
Summary: IPA dictionary for MeCab
Summary(ja): MeCab用のIPA辞書
Name: %{name}
Version: %{ver}.%{date}
Release: %{release}
@PWSdelta
PWSdelta / rspec_model_testing_template.rb
Last active March 11, 2025 21:14
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@ka8725
ka8725 / states_matcher.rb
Created December 13, 2013 12:23
Custom matcher for Rspec to test state_machine status flow
# This custom matcher can be used to test state machine
#
# Examples
#
# it { should have_event(:status, :event_name, [:state1, :state2] => [:state3, :state4]) }
# it { should have_event(:status, :event_name, {
# :state1 => :state3,
# :state1 => :state4,
# :state3 => :state3,
# :state2 => :state4
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 13, 2025 09:47
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end

Notes about tools for measuring and learning about performance.

Tools that can be used

Name + Link Usecase
Google Pagespeed Insights (PSI) Measuring load and render performance, highlighting basic responsive design issues
What does my site cost Measuring how much the payload of a website costs in different countries
Webpagetest Measuring load and render performance, with comprehensive video and waterfall charts, on a choice of devices and connection speeds
Google Lighthouse ("Audits" tab in Chrome Devtools) Measuring load and render performance, and some basic best practice, PWA, and accessibility criteria