Skip to content

Instantly share code, notes, and snippets.

View hvitis's full-sized avatar
👨‍🔬
Never trust atoms; they make up everything.

Adam Piskorek hvitis

👨‍🔬
Never trust atoms; they make up everything.
View GitHub Profile
@hvitis
hvitis / gist:65d928dc1a68126b8098e2d52ff66154
Created October 18, 2020 16:24
DRF Filepond implementation
```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
@hvitis
hvitis / load_dotenv.sh
Created January 28, 2021 19:32 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@hvitis
hvitis / load_dotenv.sh
Created January 28, 2021 19:32 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@hvitis
hvitis / load_dotenv.sh
Created January 28, 2021 19:32 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
@hvitis
hvitis / Count lines in Git repo
Created January 30, 2021 21:08 — forked from mandiwise/Count lines in Git repo
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l
@hvitis
hvitis / imagewiththumbnails_updateable.py
Created February 13, 2021 02:36 — forked from valberg/imagewiththumbnails_updateable.py
Django create thumbnail form ImageField and save in a different ImageField - now with updating!
# 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(
@hvitis
hvitis / PaperJS with GatsbyJS to use Raster mosaic functionality.
Last active October 6, 2021 13:01
PaperJS with GatsbyJS to use Raster mosaic functionality.
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) {
@hvitis
hvitis / redis-autostart-osx.md
Created November 5, 2021 09:38 — forked from subfuzion/redis-autostart-osx.md
redis auto start OS X

Install with Homebrew

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)

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?