Skip to content

Instantly share code, notes, and snippets.

@hieuns
hieuns / item_type.rb
Created October 4, 2019 04:31
Use graphql-batch with graphql-ruby to resolve n + 1 issue
module Types
class ItemType < GraphQL::Schema::Object
field :id, ID, null: false
field :title, String, null: false
field :description, String, null: true
field :image_url, String, null: true
# (graphql-ruby 1.9.12)
# instead of using `resolve` inside block of `field` like this:
#
# field :user, Types::UserType, null: false do
@hieuns
hieuns / install_godot.sh
Last active January 11, 2024 02:50
Install Godot Engine and create its .desktop file
#!/bin/bash
TMP_PATH="/tmp/godot.zip"
GODOT_LINK=$1
GODOT_DEST="/usr/bin"
GODOT_PATH="/usr/bin/godot"
ICON_DIR="/usr/share/icons/hicolor/scalable/apps"
ICON_PATH="$ICON_DIR/godot.svg"
ICON_URL="https://upload.wikimedia.org/wikipedia/commons/6/6a/Godot_icon.svg"
@hieuns
hieuns / rails_ssl.md
Created February 5, 2020 06:48
Run rails server in development environment with SSL
@hieuns
hieuns / .vimrc
Created April 19, 2021 04:30
Vimrc
set nocompatible
filetype off
set encoding=utf-8
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'kien/ctrlp.vim'