This file contains hidden or 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
#!/bin/bash | |
# get current branch name | |
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
push_heroku_branch() | |
{ | |
git push -f heroku deploy-to-heroku:master | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang='ja'> | |
<head> | |
<meta charset='UTF-8'> | |
<title>カレーのレシピ</title> | |
</head> | |
<body> | |
<header> | |
<h1>カレーのレシピ</h1> | |
<p>誰でもできる、美味しいカレーの作り方です。旦那も息子もこのカレーが大好物。</p> |
This file contains hidden or 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
# cf: https://hub.docker.com/r/heroku/ruby/~/dockerfile/ | |
FROM heroku/cedar:14 | |
RUN mkdir -p /app/user | |
WORKDIR /app/user | |
ENV GEM_PATH /app/heroku/ruby/bundle/ruby/2.2.0 | |
ENV GEM_HOME /app/heroku/ruby/bundle/ruby/2.2.0 | |
RUN mkdir -p /app/heroku/ruby/bundle/ruby/2.2.0 |
This file contains hidden or 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
### | |
# Post coverage rate to Slack | |
# | |
# Usage: bash circleci-coverage-slack.sh [simplecov|cobertura|jacoco] | |
# | |
# Required environment variables: | |
# | |
# - CIRCLE_TOKEN: project-specific readonly API token (need to access build artifacts for others) | |
# - SLACK_ENDPOINT: Slack endpoint url | |
# - COVERAGE_FILE: coverage filename (default: .last_run.json) |
This file contains hidden or 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
require 'test/unit' | |
class Sample | |
def self.convert(str) | |
1 if str == '一' | |
end | |
end | |
class TestSample < Test::Unit::TestCase | |
def test_one |
This file contains hidden or 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
import Yucho from './yucho'; | |
const yuchoID = process.env.YUCHO_ID | |
const password = process.env.YUCHO_PASSWORD | |
const aikotoba = process.env.YUCHO_AIKOTOBA | |
(async () => { | |
const yucho = await new Yucho(yuchoID, password, aikotoba) | |
await yucho.run() |
This file contains hidden or 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
import puppeteer from 'puppeteer' | |
const Readability = require("readability"); | |
import { JSDOM } from 'jsdom' | |
const URL = 'url' | |
(async () => { | |
const browser = await puppeteer.launch({ | |
args: [ | |
'--no-sandbox', |
This file contains hidden or 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
// Using https://primer.style/css | |
- flash.each do |key, value| | |
.flash-messages{data: { controller: 'flash'}} | |
.flash{class: "flash-#{key == 'alert' ? 'error' : key}"} | |
%button.flash-close{data: { action: 'flash#dismiss', target: 'flash.close'}, type: 'button'} | |
× | |
= value |
This file contains hidden or 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
!!! | |
%html | |
%head | |
%meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ | |
%title Idone.today | |
= csrf_meta_tags | |
= csp_meta_tag | |
= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' | |
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' | |
%body.bg-gray{ data: { controller: 'emoji-parser'} } |
This file contains hidden or 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
module TrackDecorator | |
include Twitter::TwitterText::Autolink | |
include Rails.application.routes.url_helpers | |
def body | |
# https://github.com/twitter/twitter-text/blob/752b9476d5ed00c2ec60d0a6bb3b34bd5b19bcf9/rb/spec/autolinking_spec.rb#L687-L689 | |
html = auto_link_hashtags(raw_body, { :hashtag_url_block => lambda { |url| project_path(self.project) } , hashtag_class: 'Label Label--gray'}) | |
raw html | |
end | |
end |