Skip to content

Instantly share code, notes, and snippets.

{
"public_identifier": "johnrmarty",
"profile_pic_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/johnrmarty/profile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240515%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240515T165245Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=1d17de793ea7fe2321ba9a239a81a3f14b8aa393903eed1c2cdd49553bbf1e44",
"background_cover_image_url": "https://s3.us-west-000.backblazeb2.com/proxycurl/person/johnrmarty/cover?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=0004d7f56a0400b0000000001%2F20240515%2Fus-west-000%2Fs3%2Faws4_request&X-Amz-Date=20240515T165245Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=e12ab40bb657027496318937a08292772d8b423d0c1e57d664474b282b4c6bbf",
"first_name": "John",
"last_name": "Marty",
"full_name": "John Marty",
"follower_count": 261634,
"occupation": "Co-Founder at FF Real Estate",
"headline": "LinkedIn Top Voice",
/**
* Update Event Logs convertedTime
*/
function convertToCST(utcTimestamp) {
// Parse the UTC timestamp string into a Date object
const date = new Date(utcTimestamp);
// Check if daylight saving time (DST) is in effect
const isDST = () => {
const january = new Date(date.getFullYear(), 0, 1);
@cesarkohl
cesarkohl / fibonacci.ts
Last active May 18, 2023 13:57
Fibonacci
function fibonacci(len) {
const arr = [];
////
// Moved the conditionals out of the loop
if (len >= 1) {
arr.push(0);
}
if (len >= 2) {
export interface IKeyCollection<T> {
add(key: string, value: T);
containsKey(key: string): boolean;
size(): number;
getItem(key: string): T;
removeItem(key: string): T;
getKeys(): string[];
values(): T[];
}
@cesarkohl
cesarkohl / .env
Created August 23, 2021 16:07
JWT Node
SECRET=mySecret
@cesarkohl
cesarkohl / sketchToBitmap.sh
Last active January 15, 2021 11:57
Sketch to Bitmap
################################################################################
################################################################################
# Main program #
################################################################################
################################################################################
Main()
{
echo Duplicating ${1}...
cp ${1} sketch.zip
Now as far for implementation of your REST, these are the typical implementation that I have encountered:
GET /logout
Execute logout in the backend and return JSON for denoting the success/failure of the operation
POST /login
Submit credentials to the backend. Return success/failure. If successful, normally it will also return the session token as well as the profile information.
POST /register
Submit registration to the backend. Return success/failure. If successful, normally treated the same as successful login or you could choose to make registration as a distinct service
<!DOCTYPE html>
<html>
<head>
<script src="main.js"></script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script src="script-1.js"></script>
<script src="script-2.js"></script>
<script src="script-3.js"></script>
</head>
<body>
</body>
</html>