In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
// | |
// ContentView.swift | |
// NestedObservables | |
// | |
// Created by Craig Hockenberry on 7/2/24. | |
// | |
import SwiftUI | |
@Observable |
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'timescaledb' | |
gem 'bulk_insert' | |
gem 'pry' | |
end | |
require 'timescaledb' |
import SwiftUI | |
struct ContentView: View { | |
@State private var preferences = PreferencesModel() | |
var body: some View { | |
VStack { | |
HStack { | |
Text("Value: ") | |
Text(preferences.theNumber.formatted()).bold() |
import SwiftUI | |
struct ContentView: View { | |
@Environment(PreferencesModel.self) var preferences | |
var body: some View { | |
Text("Salary: \(preferences.salary)") | |
} | |
} |
Rails.application.configure do | |
# Add Cloudflare's IPs to the trusted proxy list so they are ignored when | |
# determining the true client IP. | |
# | |
# See https://www.cloudflare.com/ips-v4/ and https://www.cloudflare.com/ips-v6/ | |
config.action_dispatch.trusted_proxies = ActionDispatch::RemoteIp::TRUSTED_PROXIES + %w[ | |
173.245.48.0/20 | |
103.21.244.0/22 | |
103.22.200.0/22 | |
103.31.4.0/22 |
# Set HONEYBADGER_FOO_BAR_JOB=asdf where asdf is the check in value Honeybadger gives you. | |
class ApplicationJob < ActiveJob::Base | |
after_perform { |job| job.honeybadger_checkin } | |
# Check in with Honeybadger to let us know that the job was performed | |
# if there is an identifier configured for the job. | |
def honeybadger_checkin | |
identifier = honeybadger_checkin_identifier | |
return unless identifier.present? |
require "benchmark/ips" | |
require "benchmark/memory" | |
require 'bundler' | |
class Bundler::Settings | |
def original(name) | |
key = key_for(name) | |
value = configs.values.map {|config| config[key] }.compact.first | |
converted_value(value, name) |
import Foundation | |
enum Environment: String { | |
case development, staging, production | |
} | |
extension Environment { | |
static var current: Environment { | |
if isAppStore { | |
return .production |
For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.
Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.
FROM ruby:3.1.2-bullseye
RUN apt-get update ; \