We're GitHub, the company behind the npm Registry and npm CLI. We offer those to the community for free, but our day job is building and selling useful tools for developers like you.
B! 82 0 0 0 JavaScriptは主にこのブログのために使ったりするくらいですが、 ちょっとしたテストをターミナル上でちゃっちゃとテストしたい時に 使えるものについて。 jsc SpiderMonkey Rhino Node.js 出力コマンド切り替え まとめ jsc Mac限定ですが、Macにはjscというコマンドが入っています。 /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc ここへはパスが通ってないので、以下の様な 設定を.bashrcを書いておくとjscコマンドが使えるようになります。 if [[ "$OSTYPE" =~ darwin ]];then jscpath="/System/Library/Frameworks/JavaScriptCore.framew
先日、moznion氏の「実行中のプログラムの進捗度を手っ取り早く確認したい」という面白い記事を読みました。 これに影響されて、Perlと$0のウンチクを id:lesamoureuses に語ったところ地味にウケが良かったので、さらに調子に乗って、細かすぎて伝わらないPerlと$0の関係について語ります。なお、本稿の実用性はあまりありませんが、ちょっとだけあります。 概要 上述のmoznion氏のブログは、Rubyで$0をいじるとpsコマンドで見えるコマンド名が変わって便利、という話でした(「アッアッ」)。 Perlでも同様に、$0をいじることでpsコマンドで見えるCOMMAND値を変えることができます(なお時折勘違いする人がいますが、元のファイル名は変わりません。psコマンドで見える値だけです)。ただしこれはOSによって結構動作が違うので、以下しばらくLinux(CentOS)限定の話
はじめまして。インフラチームの菅原といいます。 今年の7月に入社してから、コンソールとにらめっこする毎日を過ごしています。クックパッドのようにアクセスの多いサイトのサーバを扱うことが今まで無かったので、いろいろと勉強になることが多いです。 さて、インフラチームではサーバの状況をモニタリングして、サーバに問題がないかを常に把握するようにしています。そのため日常的にtailでログを追いかけているのですが、そんなときはAWKが非常に便利なことに気付き、最近はかなりAWKにハマっています。 今回は絶賛マイブーム中のAWKの活用例をご紹介したいと思います。 なぜAWKなのか? 残念ながらAWKの知名度はあまり高くないようで、社内でも「なぜRubyでやらないのか?」と聞かれることがありました。僕も入社するまではcutの代わりぐらいにしか使っていなかったのですが、あるときログ出力の整形に使って以来、AW
はじめに 4月まで残すところ2ヶ月と迫り、新卒などを対象とした新人研修の準備が始まっている頃かと思います。 新人研修の中でgitを教える際に、筆者はtigの活用をおすすめしています。 講師の立場からすれば、短い時間に高効率でgitの本質を伝えることができます。 研修生の立場では、tigを利用して簡単で直感的にgitリポジトリを閲覧・操作することができます。 tigを使うとどうしてそうなるのか、いくつかの理由を以下に紹介します。 セットアップが簡単ですぐ使い始められる tigは依存関係が少なくポータブルな実装でありインストールが簡単です。 会社から提供する開発サーバーであっても、社員ひとりひとりが所有するPCやMacであっても、 yumやbrewなどのパッケージマネージャから少ない手順でインストールすることができます。 一例: CentOS6.4にgit tigインストールと使い方 - Qi
コマンドラインツールについて語るときに僕の語ること - YAPC::Asia Tokyo 2014 コマンドラインツールが好きで昔からつくってきた. 今年のYAPCで,そのコマンドラインツールをつくるときにどういうことを意識して作っているのか?どのような流れで開発しているのか?といったことを語る機会をもらえた. 具体的な内容については,是非トークを聴きに来てもらうとして, スライドをつくるにあったって過去に読んだ資料や,よく参考にしている記事を集め直したので,その一部を参考資料としてまとめておく. UNIXという考え方 UNIXという考え方 Mike GancarzによるUNIXの思想や哲学をまとめた本.古いが全然色あせてない. コマンドラインツールの作り方を書いた本ではないが,これらの思想の上で動くツールはこの思想に準拠して作られるべきだと思う.何度も読んで考え方を染み付かせた. 小さい
高速にGo言語のCLIツールをつくるcli-initというツールをつくった tcnkms/cli-init・GitHub cli-initを使えば,Go言語コマンドラインツール作成時のお決まりパターンをテンプレートとして自動生成し,コア機能の記述に集中することができる. デモ 以下は簡単な動作例. 上のデモでは,addとlist,deleteというサブコマンドをもつtodoアプリケーションを生成している.生成結果は,tcnksm/sample-cli-initにある. 背景 Go言語で作られたコマンドラインツールを見ていると,codegangsta/cliというパッケージがよく使われている. これは,コマンドラインツールのインターフェースを定義するためのライブラリで,これを使えば,サブコマンドをもつコマンドラインツールを簡単につくることができる(Usageを自動で生成してくれたり,bash
Eight Terminal Utilities Every OS X Command Line User Should Know The OS X Terminal opens up a world of powerful UNIX utilities and scripts. If you’re migrating from Linux, you’ll find many familiar commands work the way you expect. But power users often aren’t aware that OS X comes with a number of its own text-based utilities not found on any other operating system. Learning about these Mac-only
GNU Projectのgrep開発チームは2月17日、最新安定版「grep-2.17」をリリースした。パフォーマンスの向上が行われており、「10倍の高速化」が実現されているという。 grepはファイルから特定のパターンを検索するツールで、「global regular expression print」の略。正規表現による検索も可能で、多くのUNIX系システムで使われているほか、Windowsでも動作する。 grep 2.17は1月初めに公開されたバージョン2.16に続く安定版。7週間で8人の開発者より合計19のコミットがあったという。最大の特徴は性能。バッファモードの活用などにより、マルチバイト文字列に対し-iオプションを利用し、\または[が含まれていないパターンを検索する際の速度が10倍高速になったという。-iオプションを利用しない場合は、最大7倍程度の改善が可能だそうだ このほかg
入門編と初級編の差は何かと申し上げますと、それはただの気分だとしか説明しようがないわけですが、そのあたりについては、さらっとスルーしていただきまして。 以下三つほど書いてきました。 iOS向け Xcode開発Tips初級編 -とりあえず最初にやってること- iOS向け Xcode開発Tips初級編その2 -ちょっと便利なショートカットキー8つ- 【iOS】 Xcode開発Tips入門編その3 -NSLogあれこれ3つほど- で、今回はブレークポイントを。 ある程度ご存知の方もいらっしゃるかと思いますので目次を 目次 1.ブレークポイントの追加及び削除もろもろ 2.ブレークポイントで停止してから変数を編集 3.Step Over / Step into / Step out もろもろ 4 ブレークポイントの編集 - 条件指定 - 5 ブレークポイントの編集 - オプション - 6 ブレークポ
情報収集はビジネスマンとしての基本である。しかし普段シェルで作業する者としては、毎回ブラウザを立ち上げる時間すら不毛である。よって、シェルから一瞬で情報収集できるRubyのワンライナーを書いた。 上からYahoo, はてな, Naverまとめ, 2ちゃん $ ruby -r open-uri -e 'open("http://www.yahoo.co.jp").read.scan(/topics.+?>([^<]+?)</) {|m| puts m}' $ ruby -r open-uri -e 'open("http://b.hatena.ne.jp/hotentry").read.scan(/entry-link.+>(.+?)</) {|m| puts m}' $ ruby -r open-uri -e 'open("http://matome.naver.jp/").read.sc
はてなグループの終了日を2020年1月31日(金)に決定しました 以下のエントリの通り、今年末を目処にはてなグループを終了予定である旨をお知らせしておりました。 2019年末を目処に、はてなグループの提供を終了する予定です - はてなグループ日記 このたび、正式に終了日を決定いたしましたので、以下の通りご確認ください。 終了日: 2020年1月31日(金) エクスポート希望申請期限:2020年1月31日(金) 終了日以降は、はてなグループの閲覧および投稿は行えません。日記のエクスポートが必要な方は以下の記事にしたがって手続きをしてください。 はてなグループに投稿された日記データのエクスポートについて - はてなグループ日記 ご利用のみなさまにはご迷惑をおかけいたしますが、どうぞよろしくお願いいたします。 2020-06-25 追記 はてなグループ日記のエクスポートデータは2020年2月28
Perlでコマンドラインオプションをparseしようと思うと組込みモジュールとしては Getopt::Std と Getopt::Long がある。が、long style option *1 つまり --option-name のようなオプションを解釈してくれるのは Getopt::Long だけだ。なので普通はこちらを使おう。 ただし 絶対にデフォルト、つまり以下のようにして使ってはいけない。 use Getopt::Long; my (@primary, @secondary, $silent); GetOptions( "server-primary|p=s" => \@primary, "server-secondary|s=s" => \@secondary, "silent|S" => \$silent ); これダメ! 絶対ダメ! 死ぬ! 最初に結論を書く 必ず以下のように
back はじめに このマニュアルは emacs (あるいは mule) を使いはじめてまだ間もない頃の 人のためのものです。emacs を一度も使ったことのない人は残念ながら 対象としていません (そういう人には emacs 付属のチュートリアルをすすめます)。 これを読んでも emacs が快適に使えるようになるかどうかはあなた次第です。 emacs はマウスやカーソルキーで操作することもできますが、 これらを使っているようでは上達しないということも 覚えておいてください。このマニュアルはよその人にも読めるように書いた つもりですが、基本的に csc (東工大 情報工学科 計算機室) で emacs を 使用する人を対象としています。そのため、日本語入力環境やメール環境については 必ずしもあなたのサイトとは一致しないかもしれませんので注意してください。 基本的なこと ファイル操作 カー
2008年03月30日19:45 カテゴリLightweight Languages一日一行野郎 perl - ワンライナーの書き方入門 まあ、ruby のコマンドラインオプションって、Perl由来ですから。 Rubyでワンライナーを書く方法のまとめ まぁ、Perlもあるしあんまり需要が無いのかも知れませんが。 というわけで、Rubyistにも役立つPerlのワンライナー入門です。 基本中の基本 コマンドとしてのperlは、スイッチがない場合、引数はスクリプト名として扱われます。 % cat hello.pl print "Hello, world!\n"; % perl hello.pl Hello, world! % コマンドライン中の文字列をスクリプトとして解釈させるには、-eを使います。 % perl -e 'print "Hello, World!\n"' Hello, worl
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く