Skip to content

Instantly share code, notes, and snippets.

@h-michael
h-michael / almost_get_status_200
Created November 17, 2018 05:07
Get many resources with Graphql
```graphql
query PullRequestTimelineItems($id: ID!, $first: Int = 10) {
node(id: $id) {
__typename
... on PullRequest {
id
author {
__typename
...custom_actor
}
@h-michael
h-michael / Cargo.toml
Last active October 20, 2018 23:37
quote test
[package]
name = "quote_test"
version = "0.1.0"
[dependencies]
quote = "0.6"
@h-michael
h-michael / lsp.rc.vim
Created September 26, 2018 08:23
Auto call hover and highlight method.
function! LspMaybeHover(is_running) abort
if a:is_running.result && g:LanguageClient_autoHoverAndHighlightStatus
call LanguageClient_textDocument_hover()
endif
endfunction
function! LspMaybeHighlight(is_running) abort
if a:is_running.result && g:LanguageClient_autoHoverAndHighlightStatus
call LanguageClient#textDocument_documentHighlight()
endif
@h-michael
h-michael / issue_timeline.graphql
Last active September 22, 2018 03:17
can not use __typename field
query GetIssueTimeline($issue_node_id: ID!, $first: Int = 100){
node(id: $issue_node_id) {
... on Issue {
id
timeline(first: $first) {
edges {
node {
__typename
}
}
@h-michael
h-michael / Failed
Created September 14, 2018 08:44
Failed query.
query GetPullRequestTimeline($pr_node_id: ID!, $first: Int = 1) {
node(id: $pr_node_id) {
... on PullRequest {
id
timeline(first: $first) {
edges {
node {
__typename
... on Commit {
...custom_commit
@h-michael
h-michael / Success
Last active September 14, 2018 08:42
Success query
query GetPullRequestTimeline($pr_node_id: ID!, $first: Int = 1) {
node(id: $pr_node_id) {
... on PullRequest {
id
timeline(first: $first) {
edges {
node {
__typename
... on Commit {
...custom_commit
@h-michael
h-michael / cp with suffix in fishshell
Created February 19, 2018 06:14
cp with suffix in fishshell
for i in (ls); echo (string replace -ra 'foo' 'bar' $i); end
@h-michael
h-michael / gist:0c67ffe9b5ce1145578f048bccb64add
Created March 31, 2017 15:24
load active record precount after bullet
require "active_support/lazy_load_hooks"
# ActiveSupport.on_load(:active_record) do
ActiveSupport.on_load(:bullet) do
require "active_record/precount/autosave_association_extension"
require "active_record/precount/base_extension"
require "active_record/precount/collection_proxy_extension"
require "active_record/precount/has_many_extension"
require "active_record/precount/relation_extension"
require "active_record/precount/reflection_extension"
git log --numstat --pretty="%H" --author='Hirokazu Hata' --since=YYYY-MM-DD --until=YYYY-MM-DD --no-merges | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("%d (+%d, -%d)\n", plus+minus, plus, minus)}'
@h-michael
h-michael / file0.vim
Created September 18, 2016 15:51
Neomakeでtscを使う際にprojectのtsconfigを使うようにする設定 ref: http://qiita.com/h-michael/items/1330795b73ba4a5007db
let g:neomake_typescript_tsc_maker = {
\ 'args': [
\ '--project', getcwd(), '--noEmit'
\ ],
\ 'append_file': 0,
\ 'errorformat':
\ '%E%f %#(%l\,%c): error %m,' .
\ '%E%f %#(%l\,%c): %m,' .
\ '%Eerror %m,' .
\ '%C%\s%\+%m'