This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Get a random integer between two integers | |
const random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min) | |
// 2. Check if an object is an empty object | |
const isEmpty = obj => Reflect.ownKeys(obj).length === 0 && obj.constructor === Object | |
// Shuffle array | |
const shuffleArray = (arr) => arr.sort(() => Math.random() - 0.5) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Napisz funkcję, która przyjmuje jako argument tablicę liczb całkowitych oraz liczbę całkowitą n i jako wynik zwraca wartość logiczną określającą czy w tablicy istnieją dwie liczby, których suma jest równa n . | |
def containsSum(numbers, n) | |
return false if numbers.length < 2 | |
result = false | |
length = numbers.length | |
for i in 0..(length-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.around(:each, :with_database_cleaner) do |example| | |
DatabaseCleaner.cleaning do | |
example.run | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails routes -c controller_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elixir -v | rg Elixir | awk '{ print $2 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -oP '(?<=Elixir )[^ ]*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bundle config --global build.mysql2 --with-opt-dir="$(brew --prefix openssl)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function detectTaskAnProject({ getters, dispatch }) { | |
let projects = getters['project/projects']; | |
if (!projects.length) { | |
projects = await dispatch('project/fetch'); | |
} | |
const tab = await getTabInfo(); | |
const system = await detectSystem(projects, tab); | |
const project = await detectProject(projects, system.id); | |
let task = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.abc.dfu.'.replace(/(^\.|\.$)/g,'') |
NewerOlder