Skip to content

Instantly share code, notes, and snippets.

View gsuuon's full-sized avatar

Steven Sun gsuuon

View GitHub Profile
@gsuuon
gsuuon / gdscript.lua
Created October 24, 2024 05:52
nvim godot lsp setup in `after/ftplugin/`
local port = os.getenv('GDScript_Port') or '6005'
local pipe = [[\\.\pipe\godot.pipe]]
vim.lsp.start({
name = 'Godot',
cmd = vim.lsp.rpc.connect('127.0.0.1', port),
root_dir = vim.fs.root(0, {'project.godot', '.git'}),
on_attach = function()
if not vim.tbl_contains(vim.fn.serverlist(), pipe) then
vim.fn.serverstart(pipe)
@gsuuon
gsuuon / notify.lua
Last active December 15, 2023 05:23
Send system notifications from neovim
local function notify(text)
vim.loop.new_tty(2, false):write('\x1b]9;' .. text .. '\07')
end
notify('hey')
@gsuuon
gsuuon / brackpipe.lua
Last active December 12, 2023 18:15
Pipes in lua with metamethods
local function pipe(val)
return setmetatable({ val = val }, {
__index = function(_, fn)
return pipe(fn(val))
end,
__unm = function(x)
return x.val
end
})
end
@gsuuon
gsuuon / readme.md
Last active October 4, 2023 15:57

ambient cold chicken demo with laggy input - it got much worse at points, felt like almost a full second delay between mouse and view

@gsuuon
gsuuon / colors.lua
Last active July 10, 2024 21:21
My styled wezterm config - just the relevant bits
local wezterm = require 'wezterm'
local color_default_fg_light = wezterm.color.parse("#cacaca") -- 💩
local color_default_fg_dark = wezterm.color.parse("#303030")
return {
VERIDIAN = {
bg = wezterm.color.parse("#4D8060"),
fg = color_default_fg_light
},
@gsuuon
gsuuon / Program.fs
Last active August 15, 2021 00:50
Monitor process / start stop - figure out what's stealing focus
open System
open System.Diagnostics
type KnownProcess =
{ pid : int
name : string
path: string
}
static member Show (x: KnownProcess) =
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
set nocompatible
set number
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
set formatoptions+=l
@gsuuon
gsuuon / react-bound-test.js
Created February 4, 2017 00:01
Learning how to spy on bound React component methods with Sinon
import React, { Component } from 'react'
import chai, { expect } from 'chai'
import { mount } from 'enzyme'
import chaiEnzyme from 'chai-enzyme'
chai.use(chaiEnzyme())
import sinon from 'sinon'
class FormComponent extends Component {
@gsuuon
gsuuon / .gvimrc
Created October 31, 2016 18:13
Vim config
set noeb vb t_vb=
set lines=999 columns=999
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
set guifont=Consolas:h12:cANSI
colorscheme Distinguishe