brew install redis
Set up launchctl to auto start redis
$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents
/usr/local/opt/redis/
is a symlink to /usr/local/Cellar/redis/x.y.z
(e.g., 2.8.7
)
// Nullish coalescing operator with conditional chaining | |
let alien = { | |
isAware: true, | |
location : { | |
planet: "C435", | |
distance: 30 // light years | |
} | |
}; | |
const alienGreeting = alien?.name ?? "Welcome Stranger!"; |
# Copyright (c) 2012, Vehbi Sinan Tunalioglu <[email protected]> | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions | |
# are met: | |
# | |
# - Redistributions of source code must retain the above copyright | |
# notice, this list of conditions and the following disclaimer. | |
# |
# Extension of http://www.yilmazhuseyin.com/blog/dev/create-thumbnails-imagefield-django/ | |
# Note: image_folder and thumbnail_folder are both a callable (ie. a lambda that does a '/'.join()) | |
class Image(Media): | |
image = models.ImageField( | |
upload_to=image_folder | |
) | |
thumbnail = models.ImageField( |
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository | |
$ git ls-files | xargs wc -l |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi |
import React from "react" | |
import { Form, Container, Row, Col, Badge } from "react-bootstrap" | |
import colors from "./utils/colors.json" | |
import BadgeColor from "./utils/BadgeColor.tsx" | |
import { IoIosCheckmarkCircle, IoIosCheckbox } from "react-icons/io" | |
import { formatAndDownloadBsxFile } from "./utils/formatBsxFile" | |
import { formatAndDownloadXmlFile } from "./utils/formatXmlFile" | |
import { formatAndDownloadLdrFile } from "./utils/formatLDrawFile" | |
class PaperCanvas extends React.Component { | |
constructor(props) { |
```js | |
<file-pond | |
name="filepond" | |
ref="pond" | |
label-idle="Drop file here..." | |
v-bind:allow-multiple="false" | |
accepted-file-types="image/jpeg, image/png, image/jpg" | |
v-bind:files="myFiles" | |
v-on:init="handleFilePondInit" <-- Example optional hook | |
v-on:processfile="handleFilePondSuccessProcessed" <-- Example optional hook |