Search By Label
text = "Hello, World! This is a test. Hello, Universe!" new_text =text.sub("Hello", "Hi") puts new_text # => "Hi, World! This is a test. Hello, Universe!"
const numbers: readonly number[] = [1, 2, 3]; numbers[0] = 4; // Error! Cannot assign to an element of a readonly array numbers.push(4); // Error! Cannot push to a readonly array
"".present? # false (empty string) " ".present? # false (whitespace characters only) nil.present? # false (nil) "hello".present? # true (contains non-whitespace characters) [1, 2, 3].present? # true (array with elements)
"".blank? # true (empty string) " ".blank? # true (whitespace characters only) nil.blank? # true (nil) "hello".blank? # false (contains non-whitespace characters) [1, 2, 3].blank? # false (array with elements)
-- Assigning Values to Variables DECLARE @variable_name data_type; SELECT column_name INTO @variable_name FROM table_name WHERE condition;-- Creating a New Table
SELECT column1, column2 INTO new_table FROM old_table WHERE condition;-- Inserting Data into an Existing Table
INSERT INTO existing_table (column1, column2)
SELECT column1, column2 FROM source_table WHERE condition;
const number = 123456.789;console.log(new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(number));
// Expected output: "123.456,79 €"// The Japanese yen doesn't use a minor unit
console.log(new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(number));
// Expected output: "¥123,457"// Limit to three significant digits
console.log(new Intl.NumberFormat('en-IN', { maximumSignificantDigits: 3 }).format(number));
// Expected output: "1,23,000"
Enumerable#cycle
offers an easy way to either repeat a certain pattern n times or just to switch between two predefined states. irb> array = [1, 2, 3] => [1, 2, 3] irb> array.cycle(3).to_a => [1, 2, 3, 1, 2, 3, 1, 2, 3]
irb> button = ['on', 'off'].cycle => # irb> button.next => "on" irb> button.next => "off"
export EDITOR=
bundle open
wicked_pdf
gem is:template: 'folder/file', formats: [:html]
// Start the timer console.time('myTimer');// Simulate a time-consuming operation
for (let i = 0; i < 1000000; i++) {
// Some code here
}// Stop the timer and display the elapsed time in milliseconds
console.timeEnd('myTimer');