Skip to content

Instantly share code, notes, and snippets.

@TimMedcalf
TimMedcalf / tableViewKeyboardHandling.m
Last active May 6, 2024 14:21
The easy & reliable way of handling UITableView insets when the keyboard is shown. This works unchanged no matter where the table view is on the screen (including dealing with orientation, hierarchy, container view controllers & all devices)
/*
One of the first things someone new to iOS Development finds is that dealing with the keyboard is trickier
than they think it should be. Simply changing the scrolling extents of a UITableView (or UIScrollView, or
UICollectionView) that is partially covered by they keyboard reveals a lot about the internals of how iOS
works and highlights various "gotchas" that need to be considered.
There are various ways to know that a keyboard has been shown - but observing some specific notifications
provides a reliable way to allow you to modify your views to deal with it.
@fbatschi
fbatschi / bash-smtp-auth-email
Created March 17, 2015 21:18
How to send an email from bash via SMTP Auth
echo "PUT YOUR MAIL BODY HERE" | mailx -s "SUBJECT" -S smtp=smtp://yoursmtpserver.com -S smtp-auth=login -S smtp-auth-user=YOUR_USERNAME -S smtp-auth-password=YOUR_PASSWORD -S from="Sender Name <sender@mail.com>" recipient@mail.com
@matthewpi
matthewpi / README.md
Last active May 6, 2024 14:16
Nix on Fedora

NixOS on Fedora

Please note that these instructions are not offically supported or condoned by Nix and are not guaranteed to always work, but from my testing everything seems to work perfectly fine.

These steps may not be required if NixOS/nix#2374 is resolved.

SELinux

These commands are required for both Fedora Workstation and Fedora Silverblue

@infocynic
infocynic / SalesforceIntegrationLicenseHOWTO.md
Last active May 6, 2024 14:16
How to use Salesforce Integration User Licenses

How to make an integration user using the new licenses that became available in April 2023:

If you want to just do it the "easy" way and have the minimum number of PSets, completely bespoke for this integration:

  1. Make a user with the Minimum Access - API Only Integration Profile.
  2. Create a new Permission set that has the "Salesforce API Integration" license. There is a very similarly named license that will not work. Be sure you are using this one. Add all the permissions you need in this pset.
  3. If you are working with packages like Salesforce CPQ, you may need to make additional PSets that have Permission Set Licenses. Those permission sets cannot apply App or System Permissions. **You cannot use any Permission Set that requires a different User License, such as "Salesforce."
  4. Assign this/these Pset(s) to the user
  5. Assign the Integration PSL to that user
@beugley
beugley / mail_it.sh
Last active May 6, 2024 14:15
bash script to send email as plain text or HTML, with attachments
#!/bin/sh
###############################################################################
## mail_it.sh
## A bash script that sends email as either plain text or HTML. It allows
## multiple recipients, CC addresses, reply-to addresses, and attachments.
##
## Usage: mail_it.sh -s subject -m message -f from_address
## -t to_address[,...] [-c cc_address[,...]] [-r reply_to_address[,...]]
## [-a attachment[,...]] [-h]
## subject: email subject
@chranderson
chranderson / nvmCommands.js
Last active May 6, 2024 14:15
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@ChenYFan
ChenYFan / ip.txt
Created May 14, 2021 11:51
Vercel All IP
34.95.57.145 [加拿大 魁北克省蒙特利尔 Google 云计算数据中心]
13.49.54.242 [瑞典 斯德哥尔摩 Amazon 数据中心]
18.178.194.147 [日本 东京都东京 Amazon 数据中心]
52.79.72.148 [韩国 首尔 Amazon 数据中心]
35.180.16.12 [法国 巴黎 Amazon 数据中心]
18.206.69.11 [美国 弗吉尼亚州阿什本 Amazon 数据中心]
52.76.85.65 [新加坡 Amazon 数据中心]
18.130.52.74 [英国 伦敦 Amazon 数据中心]
35.202.100.12 [美国 Merit 网络公司]
35.195.188.93 [比利时 瓦隆大区圣吉斯兰 Google 云计算数据中心]

Transparent Restaurant Backend

In this task, you're going to implement a REST API for a interacting with a menu of a restaurant. The menu is given to you as a JSON file which you will parse and perform operations on. The required features will be listed below.

Description

In this restaurant, honesty is extremely promoted. So extreme, that the restaurant declares that differing quality of ingredients are used in their meals. Like that's not enough, it also allows the customers to choose the ingredients of each meal in different qualities. Each ingredient has the following quality levels:

  • low: the cheapest
  • medium: moderate
@otkrsk
otkrsk / multiple-ssh-authkeys.md
Last active May 6, 2024 14:12
Add multiple SSH keys to the authorized_keys file to enable SSH authentication when connecting to a server.

Step 1: Generate first ssh key Type the following command to generate your first public and private key on a local workstation. Next provide the required input or accept the defaults. Please do not change the filename and directory location.

workstation 1 $ ssh-keygen -t rsa

Finally, copy your public key to your remote server using scp

@Ynng
Ynng / custom.css
Last active May 6, 2024 14:10
vscode vtuber logo
.editor-group-watermark > .letterpress{
background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode-Thick.png") !important;
opacity: .75;
aspect-ratio: 3/2 !important;
}