Skip to content

Instantly share code, notes, and snippets.

[client-notification] Sat Jan 6 09:55:51 2024:
(:jsonrpc "2.0" :method "textDocument/didChange" :params
(:textDocument
(:uri "file:///Users/james/work/myproj/demo.rb" :version 8)
:contentChanges
[(:range
(:start
(:line 0 :character 0)
:end
(:line 0 :character 0))

ogp

Mix.install([
  {:kino, "~> 0.6.1"},
  {:ogp, "~> 1.0"}
])
@goofansu
goofansu / app.js
Last active August 5, 2023 04:05
LiveView upload directly to AWS China S3
let Uploaders = {}
Uploaders.S3 = function (entries, onViewError) {
entries.forEach(entry => {
let xhr = new XMLHttpRequest()
onViewError(() => xhr.abort())
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error())
xhr.onerror = () => entry.error()
xhr.upload.addEventListener("progress", event => {
if (event.lengthComputable) {
@goofansu
goofansu / .envrc
Created May 21, 2023 02:39
Nix: basic configuration for a newly created Rails 7 application
if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8="
fi
use flake
PATH_add bin
@goofansu
goofansu / .envrc
Last active May 18, 2023 09:50
Rails development environment powered by Nix + Direnv
use flake
# Use binstubs directly
PATH_add bin
# Web server port
export PORT=3000
# MySQL config directory
export MYSQL_HOME=./config
user: james
GET /admin/activities.js?timestamp=&filter=&further_actions=true
USE eager loading detected
Import => [:form]
Add to your query: .includes([:form])
Call stack
/Users/james/src/openapply/app/models/import.rb:292:in `student_count'
/Users/james/src/openapply/app/extras/view_object/admin/concern/acts_as_activity_decorator.rb:214:in `i18n_options'
/Users/james/src/openapply/app/extras/view_object/admin/concern/acts_as_activity_decorator.rb:96:in `description'
/Users/james/src/openapply/app/views/nv/admin/activities/index.html.haml:33:in `block (2 levels) in _app_views_nv_admin_activities_index_html_haml___2599236250980066899_703020'
13399
13677
11945
9861
6484
4257
6616
7349
7758

Day 3

Mix.install([
  {:finch, "~> 0.12.0"}
])

Day 2

Mix.install([
  {:finch, "~> 0.12.0"}
])

Day 1

Mix.install([
  {:finch, "~> 0.12.0"}
])