This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['master','develop','preview'].map{|v| v.split('') }.map {|v| [v, v.length]}.sort_by {|v| v.last }.tap {|v| v.each {|y| y[y.length] = v.first.last; }}.map {|v| Array.new(v.last){|idx| v.first[idx] }}.transpose.to_s.split('').drop(1).reverse.drop(1).join.gsub('"', '').gsub(',', '').gsub(' ', '').prepend('*').reverse | |
# => "[mdp][aer][sve][tev][eli][roe]*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ===== Usage ===== | |
# def hoge | |
# "called" | |
# "hoge" | |
# end | |
# | |
# hash = Hash.new | |
# hash[:hoge] = hoge() | |
# called | |
# => "hoge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require "active_record" | |
require "active_model" | |
class Shrine | |
module Plugins | |
module FormObject | |
def self.load_dependencies(uploader, **) | |
uploader.plugin :model | |
uploader.plugin :activerecord |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:[RUBY_VERSION]-alpine[ALPINE_VERSION] AS builder | |
RUN apk update && \ | |
apk add --no-cache tzdata curl-dev g++ make git nodejs yarn mariadb-dev[if MYSQL] | |
WORKDIR /builder | |
COPY . /builder | |
COPY ./Gemfile ./Gemfile.lock ./package.json ./yarn.lock ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class AbstractValidator { | |
bind(){} | |
_validate(){} | |
backgroundValidate(){ | |
this._resetError() | |
this._validate() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@-moz-document domain("twitter.com") { | |
.css-1dbjc4n.r-1uaug3w.r-1uhd6vh.r-t23y2h.r-1phboty.r-rs99b7.r-ku1wi2.r-1udh08x, | |
.css-1dbjc4n.r-aqfbo4.r-yfoy6g.r-1ila09b.r-rull8r.r-qklmqi.r-gtdqiz.r-ipm5af.r-1g40b8q + .css-1dbjc4n.r-yfoy6g.r-184en5c, | |
.css-1dbjc4n.r-aaos50.r-1or9b2r, | |
nav.css-1dbjc4n.r-1habvwh.r-eqz5dr > a[aria-label="Search and explore"], | |
nav.css-1dbjc4n.r-1habvwh.r-eqz5dr > a[aria-label="Bookmarks"], | |
nav.css-1dbjc4n.r-1habvwh.r-eqz5dr > a[aria-label="Lists"], | |
.css-1dbjc4n.r-jw8lkh.r-e7q0ms > a[aria-label="Tweet"], | |
.css-1dbjc4n > h2[role="heading"], | |
.css-1dbjc4n.r-1habvwh.r-18u37iz.r-1wtj0ep.r-1ny4l3l.r-1j3t67a.r-1w50u8q, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Tweets without RT's | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description add 'Tweets without RTs' link to anybodies profile. | |
// @author Tsubasa Kawajiri | |
// @match https://twitter.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CSVCreator | |
class_attribute :directory | |
class_attribute :file_name | |
class_attribute :items | |
class_attribute :headers | |
class_attribute :options | |
class << self | |
def directory(directory) | |
self.directory = directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseCsvLoader | |
class_attribute :file_path | |
class << self | |
def file_path(path) | |
self.file_path = path | |
end | |
def load | |
CSV.read(file_path, headers: false, row_sep: "\n") |