In iTerm2, in the menu bar go to Scripts > Manage > New Python Script
Select Basic. Select Long-Running Daemon
Give the script a decent name (I chose auto_dark_mode.py
)
Save and open the script in your editor of choice.
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406 | |
import { sql } from "drizzle-orm"; | |
const clearDb = async (): Promise<void> => { | |
const query = sql<string>`SELECT table_name | |
FROM information_schema.tables | |
WHERE table_schema = 'public' | |
AND table_type = 'BASE TABLE'; | |
`; |
Ripgrep is a fast search tool like grep
. It's mostly a drop-in replacement for ag
, also know as the Silver Searcher.
helm-ag
is a fantastic package for Emacs that allows you to display search results in a buffer.
You can also jump to locations of matches. Despite the name, helm-ag
works with ripgrep (rg
) as well
as with ag
.
brew tap homebrew/versions | |
brew install v8-315 | |
gem install libv8 -v '3.16.14.13' -- --with-system-v8 | |
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315 | |
bundle install |
This document will not disclose the topic why you need fsm.
But if you implement fsm, then you need to do it as nearly as possible in the data.
This document will explain how you can implement it with PostgreSQL and gives developers maximum freedom.
#finds the largest product of two adjacent numbers in an array | |
def adjacentElementsProduct(inputArray) | |
inputArray.each_cons(2).map { |x, y| x*y }.max | |
end |
require "http/server" | |
class Users::Me | |
include HTTP::Handler | |
def call(context) | |
return call_next(context) unless match?(context.request) | |
STDOUT.puts "getting user info..." | |
STDOUT.puts "done!" |
rxvt.background: #000000 | |
rxvt.foreground: #D3D2D3 | |
rxvt.color0: #000000 | |
rxvt.color1: #FF7768 | |
rxvt.color2: #ABFA68 | |
rxvt.color3: #FFFD88 | |
rxvt.color4: #98D0FE | |
rxvt.color5: #FF85FD | |
rxvt.color6: #CACBFE | |
rxvt.color7: #EFEFEF |
" replace 'function' with λ | |
au BufNewFile,BufRead *.js syntax keyword javasScriptFunction function conceal cchar=λ | |
au BufNewFile,BufRead *.js hi! link javasScriptFunction Conceal | |
au BufNewFile,BufRead *.js setlocal conceallevel=2 | |
" add abbreviations for JS | |
" f_ | |
" expands to | |
" function() { | |
" <cursor> | |
" |