Skip to content

Instantly share code, notes, and snippets.

View dyanagi's full-sized avatar
😀
Trying new things

Michael (Daichi) Yanagi dyanagi

😀
Trying new things
  • Vancouver, BC
View GitHub Profile
@ftes
ftes / _error_messages.html.haml
Last active April 27, 2022 20:42
Rails bulma form builder with errors
-# layouts/_error_messages.html.haml
- if f.object.errors.any?
.notification.is-danger Please review the problems below:
- if f.object.errors[:base].present?
.notification.is-danger= f.object.errors[:base].join(', ')
@tmtm
tmtm / sjis-cp932-diff.txt
Last active April 24, 2020 05:30
MySQLのsjisとcp932で異なる文字
+------+------+-------+
| code | sjis | cp932 |
+------+------+-------+
| 815F | \ | \ |
| 8160 | 〜 | ~ |
| 8161 | ‖ | ∥ |
| 817C | − | - |
| 8191 | ¢ | ¢ |
| 8192 | £ | £ |
| 81CA | ¬ | ¬ |
@richardtorres314
richardtorres314 / flexbox.scss
Last active May 4, 2024 06:31
CSS Flexbox - Sass Mixins
// --------------------------------------------------
// Flexbox SASS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
@mixin flexbox {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
@nashirox
nashirox / rails-validates.rb
Last active May 31, 2024 04:11
Rubyのバリデーション用正規表現集
#
# 数字
#
# 全て数値(全角)
/\A[0-9]+\z/
# 全て数値(半角)
/\A[0-9]+\z/
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 21, 2024 17:56
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active May 10, 2024 20:10
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@tomas-stefano
tomas-stefano / Capybara.md
Last active May 21, 2024 02:09
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above