Search By Label
'/' even though you have another enable route '/welcome'.app/controllers/application_controller.rb:def after_sign_in_path_for(resource) welcome_path end
expresion operator ANY(subquery)
SELECT 3 = ANY (ARRAY[1, 2, 3, 4]); -- Returns TRUE
SELECT 42 = ANY (SELECT column FROM some_table); -- Returns TRUE if 42 exists in the column
SELECT 'apple' = ANY (VALUES ('banana'), ('apple'), ('cherry')); -- Returns TRUESELECT COALESCE(null, 42, 'Hello'); -- Returns 42
heroku apps
heroku apps:info --app example
REPLACE(original_string, search_string, replacement_string)
or
SELECT REPLACE('Hello, World!', 'World', 'Universe'); -- Returns 'Hello, Universe!'
SELECT CEIL(5.2); -- Returns 6
SELECT CEIL(-3.8); -- Returns -3
SELECT CEIL(10); -- Returns 10 (no change as it's already an integer)
SELECT FLOOR(5.7); -- Returns 5 SELECT FLOOR(-3.2); -- Returns -4 SELECT FLOOR(10); -- Returns 10 (no change as it's already an integer)
SELECT employee_name, salary, CASE WHEN salary < 30000 THEN 'Low Income' WHEN salary >= 30000 AND salary < 60000 THEN 'Medium Income' WHEN salary >= 60000 THEN 'High Income' ELSE 'Unknown' END AS income_category FROM employees;
async function* fetchUsers() {
let page = 1;
const perPage = 10; // Number of users per page
while (true) {
const response = await fetch(`https://api.example.com/users?page=${page}&per_page=${perPage}`);
const users = await response.json();
if (users.length === 0) {
// No more users to fetch
break;
}
for (const user of users) {
yield user;
}
page++;
}
}
// Usage:
const userGenerator = fetchUsers();(async () => {
for await (const user of userGenerator) {
console.log(`User: ${user.name}, Email: ${user.email}`);
}
})();{
"range": {
"price": {
"gte": 20,
"lte": 50
}
}
} {
"range": {
"event_date": {
"gte": "2023-01-01",
"lte": "2023-12-31"
}
}
}SELECT regexp_match(column_name, 'your_regex_pattern') AS matched_text FROM table_name;
SELECT MIN(column_name) FROM table_name;
SELECT MAX(column_name) FROM table_name;
SELECT order_id, string_agg(product_name, ', ') AS products FROM order_details GROUP BY order_id;
-- Example: Match strings that end with '-dev' SELECT * FROM your_table WHERE your_column LIKE '%-dev';