Skip to content

Instantly share code, notes, and snippets.

View johngrib's full-sized avatar
🌈
Focusing

JohnGrib johngrib

🌈
Focusing
View GitHub Profile
"""
Marks an element of a GraphQL schema as only available via a preview header
"""
directive @preview(
"""
The identifier of the API preview that toggles this field.
"""
toggledBy: String!
) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
Sub exe()
Dim i As Integer
Dim j As Integer
Dim lastRow As Integer
Dim cUp As Double
Dim cDown As Double
lastRow = 8 ' 자료가 있는 마지막 행의 숫자를 적습니다.
@johngrib
johngrib / balloon.vim
Created January 7, 2019 10:09
use balloon in gui vim
function! SimpleBalloon()
return 'Cursor is at line/column: ' . v:beval_lnum . ', ' . v:beval_col .
\ ' in file ' . bufname(v:beval_bufnr) .
\ '. Word under cursor is: "' . v:beval_text . '"'
endfunction
set balloonexpr=SimpleBalloon()
set ballooneval
@johngrib
johngrib / examples.sh
Last active January 8, 2019 14:19
Print my examples of bash commands
function exam {
wiki=`stat -f "%N" ~/johngrib.github.io/_wiki`
if [ "$1" = "-l" ]; then
egrep 'parent\s*:\s*command-line' $wiki/* -l 2> /dev/null \
| xargs grep 'summary' \
| sed "s,"$wiki"/,,; s,\.md:summary,," \
| column -ts':' | sort
return 0
fi
@johngrib
johngrib / contribution.sh
Created December 31, 2018 14:58
Show github contribution graph on terminal
#! /usr/local/bin/bash
MYGITHUB=johngrib
RAW=/tmp/$MYGITHUB-github
TABLE=/tmp/$MYGITHUB-github-table
COLORS=/tmp/$MYGITHUB-github-colors
curl -s https://github.com/$MYGITHUB/ > $RAW
TITLE=`cat /tmp/johngrib-github | pcregrep -M '[0-9,]+ contributions\s*\n\s*in the last year'`
@johngrib
johngrib / ltofzf.sh
Created December 17, 2018 05:08
print list to fzf
#! /usr/bin/env bash
function list() {
tempFile1=/tmp/`uuidgen`
tempFile2=/tmp/`uuidgen`
cat test > $tempFile1
_line=`{ grep -En "^\\s*$" $tempFile1 | cut -d: -f1; wc -l $tempFile1 | awk '{print $1}'; }`
_start=2
for ln in $_line; do
@johngrib
johngrib / .vimrc
Created October 23, 2018 12:18
.vimrc gitcommit setting
augroup git_commit_helper
autocmd FileType gitcommit set textwidth=50
autocmd FileType gitcommit set colorcolumn=+1
autocmd FileType gitcommit highlight ColorColumn ctermbg=235 guibg=#2c2d27
augroup END
@johngrib
johngrib / fibonacci.go
Created October 1, 2018 13:25
Fibonacci example with goroutine
package main
import "fmt"
func main() {
c := make(chan int, 3)
quit := make(chan int)
go func() {
@johngrib
johngrib / turtle_test.py
Created September 29, 2018 07:29
turtle triangle and rectangle
import turtle as t
t.shape("turtle") # 이 부분
t.fd(100)
t.lt(120)
t.fd(100)
t.lt(120)
t.fd(100)
t.left(120)
@johngrib
johngrib / show_turtle_symbol.py
Created September 27, 2018 14:09
turtle 보여주기
import turtle as t
t.shape("turtle") # 이 부분
t.fd(100)
t.lt(120)
t.fd(100)
t.lt(120)
t.fd(100)
t.left(120)