Skip to content

Instantly share code, notes, and snippets.

maxymajzr Advice about making app concurrency-safe

https://www.informit.com/articles/article.aspx?p=22681&seqNum=3

right now, i can tell you that your code is not concurrency-safe (meaning multiple-inserts at once):

  1. there's only 1 proper way to do it, and sadly - you will never find it anywhere in any laravel or php tutorials and it's because this issue is related to data modelling and databasesthat's how it works

  2. It takes time() and adds config('session.lifetime') to it

  3. Then you get a cookie that expires at time() + config('session.lifetime')

  4. There's very little point in making the user extend the session, it's something you make user think about and users know fuck all about techy shit

  5. Instead, you can use what google does and does it really good set a cookie for 2 years

<template>
    <div v-if="state" class="ais-GeoSearch">
        <GmapMap
            :center="center"
            :zoom.sync="zoom"
            class="ais-GeoSearch-map"
        >
        <gmap-custom-marker
                class="cursor-pointer px-2 py-2 bg-green-500 shadow-lg rounded-full transition duration-500 ease-in-out transform hover:-translate-y-1 hover:scale-110 border border-white"
@cjlaborde
cjlaborde / Big List of Real Estate APIs.md
Created June 16, 2021 10:02 — forked from patpohler/Big List of Real Estate APIs.md
Evolving list of Real Estate APIs by Category

Big List of Real Estate APIs

Listings / Property Data

####Rets Rabbit http://www.retsrabbit.com

Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.

@cjlaborde
cjlaborde / getSiteMeta.js
Created February 15, 2021 19:06 — forked from garethredfern/getSiteMeta.js
The full getSiteMeta function for a Nuxt website, including social media and SEO tags.
const type = "website";
const url = "https://bobross.com";
const title = "My Amazing Blog on The Joy of Painting";
const description = "Articles focused on the beautiful art of landscape painting.";
const mainImage = "/a-lovely-image.png";
export default (meta) => {
return [
{
hid: "description",
@cjlaborde
cjlaborde / head.js
Created February 15, 2021 18:32 — forked from garethredfern/head.js
The full head tag for a Nuxt website, including social media and SEO tags. Put this in your nuxt.config.js file.
head: {
htmlAttrs: {
lang: "en-GB",
},
title: "Articles focused on learning Laravel and VueJS",
meta: [
{ charset: "utf-8" },
{ name: "HandheldFriendly", content: "True" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{
@cjlaborde
cjlaborde / UsefulLinks.md
Last active December 4, 2020 02:18
Links of services useful for web development
We couldn’t find that file to show.
@cjlaborde
cjlaborde / JavascriptSnippets.md
Last active June 16, 2020 21:00
Javascript Snippets
@cjlaborde
cjlaborde / disposable-email-provider-domains
Created June 9, 2020 19:00
List of disposable email provider domains
0815.ru
0wnd.net
0wnd.org
10minutemail.co.za
10minutemail.com
123-m.com
1fsdfdsfsdf.tk
1pad.de
20minutemail.com
21cn.com
https://github.com/JedWatson/classnames
@cjlaborde
cjlaborde / gist:76b29dd66ed21889a2b0937c4998c77e
Last active May 7, 2020 19:40
How to interact with Libraries

How to interact with Libraries

Use querySelector

this.$refs.datepicker.$el.querySelector('.datepicker__input').click();