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
<% body = capture do %> | |
<p>ほげほげほげ</p> | |
<div>ふがふが</div> | |
<% end %> | |
<% link_to_if 条件文, body, root_path %> |
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
{ | |
"name": "unachang_site_settings", | |
"version": "1.0.0", | |
"description": "frontend template", | |
"main": "index.js", | |
"author": "unachang113", | |
"license": "MIT", | |
"dependencies": { | |
"autoprefixer": "^8.6.3", | |
"babel-cli": "^6.26.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
<?php | |
$tags = ['テスト', 'テスト投稿', 'いちご', 'みかん']; | |
$text = "#テスト ほげほげほげ #テスト投稿 #りんご"; | |
// タグの文字数が長い順に並び変える | |
array_multisort(array_map('mb_strlen', $tags), SORT_DESC, $tags); | |
foreach($tags as $tag) { | |
$hashTag = "#{$tag}"; |
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 twitterText from 'twitter-text'; | |
/** | |
* tweetの文字数のカウント | |
* @param {string} text 文字数を確認したいテキスト | |
* @return number 140文字換算でのツイートの文字数 | |
*/ | |
const tweetCount = (text: string): number => { | |
const parsedTweet = twitterText.parseTweet(text); |