Skip to content

Instantly share code, notes, and snippets.

View yoshikyoto's full-sized avatar

Yoshiyuki Sakamoto yoshikyoto

View GitHub Profile
@yoshikyoto
yoshikyoto / CallableProperty.php
Last active October 24, 2018 15:13
PHPのPropertyとCallable
<?php
/**
* callableなものをプロパティに突っ込んだときの挙動が面白い
* PHP >= 7
*/
class FuncClass {
private $func;
@yoshikyoto
yoshikyoto / gist:3b0b6c4bc7b8cbb0f2f8dd27c849ce25
Created September 7, 2018 04:53
checkouted diff server-side
```
diff --git a/MarimbaSearchAPI/marimba_search_api/management/commands/fetch_posted_article.py b/MarimbaSearchAPI/marimba_search_api/management/commands/fetch_posted_article.py
index b444ad3..44c5184 100644
--- a/MarimbaSearchAPI/marimba_search_api/management/commands/fetch_posted_article.py
+++ b/MarimbaSearchAPI/marimba_search_api/management/commands/fetch_posted_article.py
@@ -394,6 +394,8 @@ class Command(BaseCommand):
pass
self.update_article_content(ArticleClass, article, **kwargs)
article.save()
+ import time
id title first_retrieve last_retrieve
so10706808 スレッドID再取得確認 0000-00-00 00:00:00 2011-04-27 15:21:43
so11958603 AXE CM「BODY SOAP &GUY WASH 」編 0000-00-00 00:00:00 2013-07-26 09:39:08
so11958823 AXE CM「PREMIUM BLACK SHEET」編 0000-00-00 00:00:00 2010-10-07 14:55:35
so12653743 ゼロ外伝ニコ特用1.mp4 0000-00-00 00:00:00 2013-11-08 05:48:36
so16407733 [Eternity]DAZZLE VISION-2009.1.24@新宿ANTIKNOCK 0000-00-00 00:00:00 2011-12-19 13:01:48
so17960506 #29 0000-00-00 00:00:00 2013-08-18 13:02:11
so17960512 #30 0000-00-00 00:00:00 2013-08-17 06:26:08
so18612718 テスト投稿: so18612726 0000-00-00 00:00:00 2013-09-10 23:01:29
so18796778 テスト投稿: so18796778 0000-00-00 00:00:00 2015-11-22 18:59:03
@yoshikyoto
yoshikyoto / Docker.md
Created April 21, 2017 09:57
Mastodon memo
@yoshikyoto
yoshikyoto / decorator.java
Created January 22, 2016 07:10
java.ioとDecorator
// ファイルからデータを読み込むインスタンスを作成
Reader reader = new FileReader("filename");
// ファイルからデータを読み込む時にバッファリングするようになる
Reader br = new BufferedReader(reader);
// 行番号を管理できるようになる
Reader lnr = new LineNumberReader(br);
@yoshikyoto
yoshikyoto / .zshrc
Created October 2, 2015 08:30
zshrc
# Setting for Mac terminal
# Profile: Pro
# font: 11 pt.
# color: black alpha 90%
# シェル ウインドウを閉じる前の確認: しない
# 以下の設定は
# http://qiita.com/harapeko_wktk/items/47aee77e6e7f7800fa03
# https://gist.github.com/mollifier/4979906
# を参考に書かれたもの
@yoshikyoto
yoshikyoto / DoYouKnow.md
Created September 18, 2015 15:24
本当にみんなわかっているのかQuestion
  • 「関数型言語」あるいは「関数型の思想を取り入れた言語」を挙げよ
  • 「関数」と「メソッド」の違いは何か答えよ
  • 「値渡し」と「参照渡し」の違いを、「同じコードでも結果が異なる例」を用いて説明せよ
@yoshikyoto
yoshikyoto / どこがだめなのかわからない.cpp
Created August 15, 2015 13:53
どこがだめなのかわからない
int main(int argc, const char * argv[]){
int n, a, b;
cin >> n >> a >> b;
int ma = 0, mi = 1<<30;
int sum = 0;
REP(i,n) {
int s;
cin >> s;
ma = max(ma, s);
mi = min(mi, s);
@yoshikyoto
yoshikyoto / init.el
Last active November 24, 2016 00:51
.emacs with el-get
;; ターミナル以外でEmacsを立ち上げてもpathが通るようにする
(defun set-exec-path-from-shell-PATH ()
"Set up Emacs' `exec-path' and PATH environment variable to match that used by the user's shell.
This is particularly useful under Mac OSX, where GUI apps are not started from a shell."
(interactive)
(let ((path-from-shell (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(set-exec-path-from-shell-PATH)
import Foundation
import CoreLocation
import UIKit
public class Location: NSObject, CLLocationManagerDelegate{
public let AuthDeniedNotification = "LSAuthDeniedNotification"
public let AuthRestrictedNotification = "LSAuthRestrictedNotification"
public let AuthorizedNotification = "LSAuthorizedNotification"
public let DidUpdateLocationNotification = "LSDidUpdateLocationNotification"