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
| /** | |
| * 標準のerror_logメソッドを拡張し、呼び出し箇所の行数等を追加表示させる | |
| * | |
| * @param $message | |
| * @param null $message_type | |
| * @param null $destination | |
| * @param null $extra_headers | |
| */ | |
| function e_log ($id, $message, $level = LEVEL_ERR , $message_type = null, $destination = null, $extra_headers = null ) { | |
| error_log('---------------------------'); |
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
| /** | |
| * 日にち毎の会員登録ユーザ数を取得する | |
| */ | |
| public function getRegisterCountDayByDay ( $limit = 30 ) { | |
| $params = array( | |
| 'fields' => array( | |
| 'count(1) as count', | |
| "DATE_FORMAT(created_at,'%Y-%m-%d') as regist_date" | |
| ), | |
| 'conditions' => array( 'created_at > (now() - interval ' . $limit . ' day)' ), |
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
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> | |
| <script type="text/javascript" | |
| src="https://www.google.com/jsapi"></script> | |
| <script type="text/javascript"> | |
| google.load('visualization', '1', {packages:['corechart']}); | |
| </script> | |
| <script type="text/javascript"> | |
| (function () { | |
| drawGraph = function () { | |
| $.ajax({ |
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
| ### Sample Settings | |
| # aliases | |
| # in this example you can open extensions page by the command ':ext' | |
| # and Chrome's option page by the command ':option' | |
| alias ext TabOpenNew chrome://extensions/ | |
| alias option TabOpenNew chrome://settings/browser | |
| alias downloads TabOpenNew chrome://downloads | |
| alias history TabOpenNew chrome://history |
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
| Jenkins × PHP環境構築の巻 | |
| ■目的 | |
| PHP環境に対応したJenkins設定を行い、 | |
| コミットされる度にサーバ上でのPHPUnitの実行 及び | |
| カバレッジレポート出力を"全自動"で行えるようにすること。 | |
| 1) PHP Pear系のインストール | |
| sudo pear channel-discover pear.phing.info | |
| sudo pear channel-discover pear.pdepend.org |
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
| protected dialog(AnActionEvent e) throws Exception { | |
| Project project = e.getProject(); | |
| DataContext dataContext = e.getDataContext(); | |
| IdeView view = LangDataKeys.IDE_VIEW.getData(dataContext); | |
| if (view == null) { | |
| return; | |
| } | |
| Project project = PlatformDataKeys.PROJECT.getData(dataContext); |
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
| public void syncWithSonar(Project project) { | |
| Collection<Rule> sonarRules = this.sonarRulesByRuleKey.values(); | |
| int oldSize = sonarRules.size(); | |
| clearState(); | |
| Collection<SonarSettingsBean> allSonarSettingsBeans = SonarSettingsComponent.getSonarSettingsBeans(project); | |
| SonarService sonarService = ServiceManager.getService(SonarService.class); | |
| if (null != allSonarSettingsBeans) { | |
| for (Rule rule : sonarService.getAllRules(allSonarSettingsBeans)) { | |
| this.sonarRulesByRuleKey.put(rule.getKey(), rule); |
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
| @Override | |
| public void fillCompletionVariants(CompletionParameters parameters, CompletionResultSet result) { | |
| String arr$[] = new String[] {"foo", "bar"}; | |
| int len$ = arr$.length; | |
| for (int i$ = 0; i$ < len$; i$++) { | |
| String s = arr$[i$]; | |
| result.addElement(createDocTagLookup(false, s)); | |
| } |
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
| #!/usr/bin/env ruby | |
| #-*- encoding: utf-8 -*- | |
| require 'json' | |
| require 'pit' | |
| require 'time' | |
| require 'net/https' | |
| require 'octokit' | |
| ## get config from pit |
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
| begin | |
| require "awesome_print" | |
| AwesomePrint.pry! | |
| rescue LoadError => err | |
| puts "no awesome_print :(" | |
| end | |
| # hirbの設定 | |
| begin | |
| require 'hirb' |