Skip to content

Instantly share code, notes, and snippets.

@0xf10yd
0xf10yd / challenge.md
Created Jan 27, 2022
SDE coding challenge at Amazon
View challenge.md

Given an array of strings, consisting of an ID and formatted date, return how many times did each ID repeat.

Each single ID should be counted as repeated only if it did occur on a different day, therefore, if one of the IDs repeated in one single day, it should not be counted as a repeation/occurance.

Example:

Given

  visits = [
@luckylittle
luckylittle / example_extension.sh
Created Jan 27, 2022
Example of the command that is useful for processes that change file extension and also have spaces in the filename
View example_extension.sh
find . type f -name '*.original_extension' -execdir /bin/zsh -c '/usr/bin/echo $0 ${0/original_extension/new_extension}' {} \;
######################################################################
## Before: ./01-Part 1.original_extension ##
## After: ./01-Part 1.original_extension ./01-Part 1.new_extension ##
######################################################################
View grcov_relative_path_output
SF:src/file_downloader.rs
FN:154,rover::file_downloader::testing_file_downloader::rover_file_download_is_successful_and_filepath_is_returned::{{closure}}::{{closure}}
FN:51,rover::file_downloader::FileDownloader::download_file
FN:150,rover::file_downloader::testing_file_downloader::rover_file_download_is_successful_and_filepath_is_returned
FN:257,rover::file_downloader::testing_file_downloader::checks_file_hash_of_downloaded_file::{{closure}}::{{closure}}::{{closure}}
FN:45,rover::file_downloader::FileDownloader::new
FN:67,rover::file_downloader::FileDownloader::download_file::{{closure}}::{{closure}}
FN:157,rover::file_downloader::testing_file_downloader::rover_file_download_is_successful_and_filepath_is_returned::{{closure}}::{{closure}}::{{closure}}
FN:171,rover::file_downloader::testing_file_downloader::rover_file_download_is_successful_and_filepath_is_returned::{{closure}}::{{closure}}
FN:150,rover::file_downloader::testing_file_downloader::rover_file_download_is_successful_and_filepath_is_returned::{{cl
@PythonRulz
PythonRulz / find_intersection_of_two_lists.py
Created Jan 27, 2022
The program takes two lists and finds the intersection of the two lists.
View find_intersection_of_two_lists.py
'''
Problem Description
The program takes two lists and finds the intersection of the two lists.
Problem Solution
1. Define a function that accepts two lists and returns the intersection of them.
2. Declare two empty lists and initialize them to an empty list.
3. Consider a for loop to accept values for the two lists.
4. Take the number of elements in the list and store it in a variable.
@juguerre
juguerre / show_only_admins.js
Created Jan 27, 2022
Show only to admins Confluence User Macro
View show_only_admins.js
#if($permissionHelper.canAdminister($userAccessor.getUserByName($req.remoteUser), $content))
$body
#end
View Changed Paths
i686-linux python39Packages.jaxlibWithCuda
i686-linux python310Packages.jaxlibWithCuda
x86_64-darwin python39Packages.jaxlibWithCuda
aarch64-linux python310Packages.jaxlibWithCuda
x86_64-linux python39Packages.jaxlibWithCuda
x86_64-darwin python310Packages.jaxlibWithCuda
x86_64-linux python310Packages.jaxlibWithCuda
aarch64-linux python39Packages.jaxlibWithCuda
View gist:c13bbfd84a6674e847dcb648f5806d91
### Keybase proof
I hereby claim:
* I am azimanuar5874 on github.
* I am thecityzens (https://keybase.io/thecityzens) on keybase.
* I have a public key ASDi-DJhRm8ToUya_Ep9_RjuNG7CRIyzSDwVmvO9Frn9qwo
To claim this, I am signing this object:
@nathanlogan
nathanlogan / DateUtils.ts
Created Jan 27, 2022
Convert date string to user's locale
View DateUtils.ts
export const formatDateAsDefaultLocale = (incomingDate: string | Date, options?: Intl.DateTimeFormatOptions): string => {
const defaultOptions = { day: 'numeric', month: 'short', year: 'numeric' }
const date = new Date(incomingDate)
return date.toString() !== "Invalid Date" ? date.toLocaleString('default', options || defaultOptions) : '';
}
View Potential Maintainers
Maintainers:
mredaelli: gurk, gurk, gurk, gurk