Skip to content

Instantly share code, notes, and snippets.

[5] pry(main)> ActiveRecord::Base.transaction do
[5] pry(main)* Staff.create!(email:"s2otsa59@gmail.com",password:"hoge",first_name:"hoge",last_name:"hoge",first_name_kana:"hoge",last_name_kana:"hoge",tel:"hoge")
[5] pry(main)* raise
[5] pry(main)* end
(0.3ms) BEGIN
Staff Create (0.5ms) INSERT INTO `staffs` (`email`, `password_digest`, `last_name`, `first_name`, `last_name_kana`, `first_name_kana`, `tel`) VALUES ('s2otsa59@gmail.com', '$2a$10$3A0bATSBfepHxZhsa52bBuc9Ps6dcq60sWyiPqEiqLuDc0EKwSWGa', 'hoge', 'hoge', 'hoge', 'hoge', 'hoge')
(1.9ms) ROLLBACK
RuntimeError:
from (pry):15:in `block in __pry__'
[6] pry(main)> ActiveRecord::Base.transaction do
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width">
</head>
<body>
<button id="my_button" class="btn btn-primary">決定</button>
<script src="webperl.js">
class AAA{
constructor(){
console.log("aaa")
}
}
class XXX{
}
class BBB extends XXX{
class AAA{
constructor(){
console.log("aaa")
}
}
class BBB{
constructor(){
console.log("bbb")
}
class AAA{
constructor(){
console.log("aaa")
}
}
class BBB{
constructor(){
console.log("bbb")
}
class A {
constructor(){
console.log("1111111111111")
}
}
class Adash extends A {
constructor(){
super()
console.log("2222222222222")
@S2
S2 / gist:7a0470d6bc7b3235dfec1e8a3bbc3a53
Created September 25, 2018 08:16
正規化されていない変な外部キーの貼り方をしていたら理不尽な消え方をしたのでまとめた。
DROP TABLE hoge_fuga_piyo;
DROP TABLE hoge_fuga;
DROP TABLE hoge;
-- -----------------------------------------------------
-- Table `hoge`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `hoge` (
id INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL ,
name varchar(255) NOT NULL
)
let strftime = require("strftime")
function getDateList(day){
let n = 3
let deliveryCandidateDays = []
while(deliveryCandidateDays.length < 8) {
let allDays = []
let m = 1
while(m <= n - 2){
@S2
S2 / gist:dd0366d62f75a0a70b205158f56445cb
Created June 14, 2018 05:41
むしゃくしゃしてCSS整形するやつ作った
#!/usr/bin/env perl
use 5.16.2;
use strict;
use warnings;
use utf8;
for my $f (@ARGV){
my $s = "";
{
open my $fh , '<' , $f or die 'cant open file !';
#!/usr/bin/env perl
use 5.16.2;
use strict;
use warnings;
use utf8;
use String::Random qw/random_regex/;
use Test::More;
for(1..20){
my $i = [map{0 + random_regex '\d{3}'}1..150];