Skip to content

Instantly share code, notes, and snippets.

View gsuuon's full-sized avatar

Steven Sun gsuuon

View GitHub Profile
@gsuuon
gsuuon / gist:c8746333820696a35a52f2f9ee6a754d
Last active January 21, 2025 00:03
How many letter R's appear in the word "strawberry"?
Okay, so I need to figure out how many times the letter "R" appears in the word "strawberry." Let me start by writing the word out and then checking each letter one by one.
First, let's spell "strawberry" correctly. S-T-R-A-W-B-E-R-R-Y. Wait, is that right? Let me make sure. Sometimes people might mix up the order of the letters, but I think "strawberry" is spelled S-T-R-A-W-B-E-R-R-Y. Let me double-check by breaking it down: "straw" + "berry." Yes, "straw" is S-T-R-A-W and "berry" is B-E-R-R-Y. So when you put them together, it's S-T-R-A-W-B-E-R-R-Y. That seems correct.
Now, let's go through each letter and count the Rs. I'll list them out:
1. S - no
2. T - no
@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 February 24, 2025 01:09
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 January 3, 2025 03:01
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