Skip to content

Instantly share code, notes, and snippets.

View anthony2025's full-sized avatar
🛵

Anthony Ascencio anthony2025

🛵
  • Alexandria, VA
View GitHub Profile
@anthony2025
anthony2025 / generate-ssh-key.sh
Created March 28, 2020 22:33 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
install essential os fonts
sudo pacman -S noto-fonts ttf-liberation noto-fonts-emoji
yay -S otf-font-awesome-5-free
install console font and main terminal/editor font
sudo pacman -S terminus-font ttf-hack
@anthony2025
anthony2025 / ssh_permissions.sh
Created February 24, 2020 19:56
keys coming from a FAT usb cannot handle linux permissions
# The private key should have read and write permissions only for the user and no other permissions for the group and others.
# You should change the permission using the chmod command:
$ chmod 600 ~/.ssh/id_rsa
# Similarly, the public key shouldn’t have write and execute permissions for group and other.
$ chmod 644 ~/.ssh/id_rsa.pub
@anthony2025
anthony2025 / dudUrl.js
Created February 7, 2019 20:35
from mui docs
// This resolves to nothing and doesn't affect browser history
const dudUrl = 'javascript:;';
val duration = (System.nanoTime - initialTime) / 1e9d
@anthony2025
anthony2025 / extractReturn.js
Created August 21, 2018 15:40
Alternative to now deprecated existential type (*)
// To get the return type of a function you can use this helper
export type ExtractReturn<Fn> = $Call<<T>((...Iterable<any>) => T) => T, Fn>;
// Example of usage:
const mapDispatchToProps = (dispatch: Dispatch) => ({
actions: {
setCompany: ({ companyId, domainName }) =>
dispatch(
setCompany({
[ignore]
.*/build/.*
.*\.re
[include]
./src
[libs]
[lints]
// takes a contract and returns an array of all the persons that passed the filters
// add as many filters as you want to the list, e.g.: filterBySalary, etc
// sort your filters so the most expensive ones are closer to the end, working with the less data
const getFilteredPersons: (Contract, ... => Array<Person>) = _.flow([
_.get('personnel'),
filterByPosition(positionFilter),
filterByDate(startDate, endDate),
filterByStatus(statusFilter, timeRange),
_.sortBy(sortKey),
R.when(
export const caseInsensitiveIncludes = _.curry((str1: string, str2: string): boolean =>
!!str1.match(new RegExp(str2, 'i')));
export const caseInsensitiveIncludes = _.curry((str1: string, str2: string): boolean =>
!!str1.match(new RegExp(str2, 'i')));