In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
# make sure all expect wait for turbo before expecting | |
module RSpec | |
module Matchers | |
expect_old = instance_method(:expect).bind(self) | |
define_method(:expect) do |*args, &block| | |
expect_old.call(page).not_to have_selector('html[aria-busy="true"]') | |
expect_old.call(page).not_to have_selector('turbo-frame[busy]') | |
expect_old.call(*args, &block) | |
end | |
end |
-- https://gitlab.com/-/snippets/2138417 | |
select | |
now(), | |
query_start as started_at, | |
now() - query_start as query_duration, | |
format('[%s] %s', a.pid, a.query) as pid_and_query, | |
index_relid::regclass as index_name, | |
relid::regclass as table_name, | |
(pg_size_pretty(pg_relation_size(relid))) as table_size, | |
nullif(wait_event_type, '') || ': ' || wait_event as wait_type_and_event, |
class Whereable | |
def initialize(where:, model: Item, ranking_conditions: [], valid: true, data_source: nil) | |
@model = model | |
@where = where | |
@data_source = data_source | |
@ranking_conditions = ranking_conditions | |
@valid = valid | |
end | |
def valid? |
-- This all starts with some functions and a *materialized* postgres view that unnests several | |
-- arrays of strings of definitions into flattened rows that are easier to search. Fun fact: | |
-- you can even create indexes on materialized views' columns! They'll refresh whenever the view | |
-- is refreshed (which in my case is every time that we pull new dictionary data from WaniKani or JMDICT | |
-- This function will take an array of strings and convert all the double-width alphanumeric characters | |
-- and normalize them as half-width. That way a search query can be massaged from "OK" to "ok" easily | |
CREATE OR REPLACE FUNCTION array_hankakufy_romaji(character varying[]) | |
RETURNS character varying[] | |
AS |
So you want to commit changes generated by a GitHub Actions workflow back to your repo, and have that commit signed automatically?
Here's one way this is possible, using the REST API, the auto-generated GITHUB_TOKEN
, and the GitHub CLI, gh
, which is pre-installed on GitHub's hosted Actions runners.
You don't have to configure the git
client, just add a step like the one below... Be sure to edit FILE_TO_COMMIT
and DESTINATION_BRANCH
to suit your needs.
# frozen_string_literal: true | |
Warning.singleton_class.prepend( | |
Module.new do | |
DISABLED_WARNINGS = Regexp.union( | |
/_pry_ is deprecated, use pry_instance instead/, | |
/warning: The called method( `.+')? is defined here/, | |
) | |
def warn(warning) |
Process.setproctitle("foo-parent") | |
ppid = Process.pid | |
fork do | |
exit if fork # You can only setsid if you're in a child process so first we fork | |
Process.setsid # and exit the parent then setsid in the child. Now that we have a | |
exit if fork # new session create a child process in it and exit the parent again. | |
Dir.chdir("/") # Finally, change directory to one that can't be deleted or moved. | |
Process.setproctitle("foo-child") |
See also:
vinegar.vim, which makes - open netrw in the directory of the current file, with the cursor on the current file (and pressing - again goes up a directory). Vinegar also hides a bunch of junk that's normally at the top of netrw windows, changes the default order of files, and hides files that match wildignore
.
With vinegar, . in netrw opens Vim's command line with the path to the file under the cursor at the end of the command. ! does the same but also prepends !
at the start of the command. y. copies the absolute path of the file under the cursor. ~ goes to your home dir. Ctrl+6 goes back to the file (buffer) that you had open before you opened netrw.
To launch netrw:
GC benchmarks for trunk vs gc-compact seem to be about the same:
$ make benchmark ITEM=gc
./revision.h unchanged
/Users/aaron/.rbenv/shims/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \
--executables="compare-ruby::/Users/aaron/.rbenv/shims/ruby --disable=gems -I.ext/common --disable-gem" \
--executables="built-ruby::./miniruby -I./lib -I. -I.ext/common -r./prelude --disable-gem" \