Skip to content

Instantly share code, notes, and snippets.

View .commit_template
# ==================== Emojis ====================
# 🎉 :tada: 初めてのコミット(Initial Commit)
# 🔖 :bookmark: バージョンタグ(Version Tag)
# ✨ :sparkles: 新機能(New Feature)
# 🐛 :bug: バグ修正(Bugfix)
# ♻️ :recycle: リファクタリング(Refactoring)
# 📚 :books: ドキュメント(Documentation)
# 🎨 :art: デザインUI/UX(Accessibility)
# 🐎 :horse: パフォーマンス(Performance)
# 🔧 :wrench: ツール(Tooling)
View MoveToXcassets.rb
require 'fileutils'
# PDFディレクトリ内に入ってる.pdfを
# Icons.xcassetsに入れる
# 素材ファイルはuniversalでvector画像に設定
# $ProjectDir/Project/Assets/Icons.xcassets
Dir.glob('PDF/*.pdf') do | f |
# f = PDF/*.pdfになるので
file=f.split("/")
file_name=file[1]
@bright23
bright23 / replace.txt
Last active Jan 14, 2020
文字列置換
View replace.txt
# 単一ファイルから
sed -i -e "s/置換したい文字列/置換後の文字列/g" [置換するファイル]
# プロジェクト全体から
ag -l 置換したい文字列 | xargs sed -i '' -e 's/置換したい文字列/置換後の文字列/g'
@bright23
bright23 / makepdf.rb
Created Feb 20, 2019
make pdf sample
View makepdf.rb
require "prawn"
f_name = File.basename(__FILE__, ".rb")+".pdf"
Prawn::Document.generate(f_name) {
stroke_axis
}
binary_text = IO.read("#{f_name}", mode: 'rb').force_encoding("utf-8")
#text.encode("UTF-8")
puts("#{binary_text}")
@bright23
bright23 / HTTPSLinkTextView.swift
Created Dec 11, 2018
HTTPSLinkTextViewSample
View HTTPSLinkTextView.swift
``` swift
class ViewController: UIViewController {
@IBOutlet weak var textView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
let baseText = "apple https://www.apple.com/jp/ thanks https://qiita.com/shtnkgm/items/3c8b6b794219fbf087ba"
let words: [String] = baseText
.components(separatedBy: .whitespacesAndNewlines)
View rtmp_player.html
<!DOCTYPE html>
<html lang="en" class="">
<head>
<link href="http://vjs.zencdn.net/4.2.0/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.2.0/video.js"></script>
</head>
<body>
<video id="rtmp live test" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="264" data-setup='{}'>
<source src="rtmp://192.168.33.10/live/test" type='rtmp/mp4'>
View BlockListUrls.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
http://zakuzaku911.com/archives/4770579.html?jprank=5&cat=46
http://click.amanad.adtdp.com/3QtIobHlkFT0BMKDIQMIAQ/click?tk=B6tcbK-f6NnOM73k6lZoK34iHhIRuS17PIsg9lVG8NZvUVGkes08LCtEhPNwRdXQRtYnwp7nb2QAiZ0of_wFkQS2xdGhPEMHbbv-7lbNQ-rObGFw1obEwSMKDwDcMOK1eJpaqQsrSN10wwkKHW7mrCvS8BkaTDfeC4coo1gZiFOx-HlcammkZEF4uAPtUjxXpsrtLFaDKtqTL0xWjcHRUN434vwzBq9T4vfsP8jWiuDLrvOrqW8PFaQqLg6FTCRS1lJ5Q7YJKhP4Saw38bJuRipmsFUpVH7HBqbhCiKHQ5Y0P3QXLmczi5aP9QTen8wVMMZTHDYx0NFMvpjalebIRkjJ-l0xFIY-VEWnur_-QqFKnFq1mifPTZcBRi7ApO14M1TlHaGqLu7RWYQUihh33-CL9Jc3NTFJM535qWg4cVpZGPwZMLcIFYt-ySFB7i_giyeqbJDH14PlyLn1LlI7i8vclUQ4-gjjxgNuNyO66Tg538Ekhon47nnLwu6SS-zxTsSPR9QHn17i3dMnxMTTBaM1Bz8ZAZ2E1ArjKvJ8yd66XMZrQ-Xrfl01TbOlxXA1zFCusidYYbGeZhlqLdKk3puWhSHDQuJ12lgznuKdfa_ogGOCS3FirdwyCDPdNwDjhOEEZatzg8JmdGRR1PWqlcCOGegvN1w47Col9mLd2DzXyMLCmzAzrDtBCd-1oIB2OruhmGWVhYyoaNUiecXGDdt73mRFijMHaRyGhm8akW6swgi1OC2ay-O4N0n_uC38b6fBJekXePbL3JVEOPoI40c_8DY9kQolDH8RvKtzmw3J1j13lfoJEi-MfI20SKwNI9oWx-9cbD7LTihze1LN8VZ23LnnhruROjuvw8KlPgCQlq-oVSl-Vg734OxR3Ifcag5W_
@bright23
bright23 / clean.sh
Created May 15, 2018
clean_macbook
View clean.sh
#!/bin/sh
sudo rm -rf ~/Library/Developer/Xcode/DerivedData/*
echo "clean Xcode/DerivedData!"
sudo rm -rf ~/Library/Developer/Xcode/Archives/*
echo "clean Xcode/Archives!"
sudo rm -rf ~/Library/Caches/*
echo "clean Library/Caches!"
sudo rm -rf ~/Library/Logs/iOS\ Simulator
echo "clean iOS logs"
View provisioning_clean_memo.txt
# provisioning 場所
cd ~/Library/MobileDevice/Provisioning\ Profiles
# project_nameを含むprovisioning
find ./ -type f -print | xargs grep 'project_name'
# project_nameを含むprovisioanig削除
@bright23
bright23 / ssh_password.txt
Last active May 15, 2018
public key置いてssh接続してるのに毎回パスワード聞かれる時
View ssh_password.txt
~/.ssh/config
Host *
UseKeychain yes
AddKeysToAgent yes
You can’t perform that action at this time.