Skip to content

Instantly share code, notes, and snippets.

View ndrean's full-sized avatar
🏠
Working from home

Neven DREAN ndrean

🏠
Working from home
  • Nantes
  • 23:02 (UTC -12:00)
View GitHub Profile
@ndrean
ndrean / elixir-hls-server-demo.livemd
Created June 12, 2024 10:08 — forked from xorvo/elixir-hls-server-demo.livemd
Elixir HLS Server Example

HLS Server Demo - My TV Station

Mix.install([
  {:plug_cowboy, "~> 2.6"}
])
@ndrean
ndrean / javascript-proxy-as-rest-client.js
Created February 8, 2022 22:49 — forked from DavidWells/javascript-proxy-as-rest-client.js
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
return async function(id = "") {
const response = await fetch(`${url}/${key}/${id}`)
@ndrean
ndrean / mac-setup-redis.md
Created November 4, 2021 13:32 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@ndrean
ndrean / introrx.md
Created December 5, 2020 18:02 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ndrean
ndrean / countContainers.sh
Created November 20, 2020 01:50 — forked from ggtools/countContainers.sh
A simple script to count the containers on a Docker host.
#!/bin/bash
function countContainers() {
docker ps -q $1 | wc -l
}
function countCrashedContainers() {
docker ps -a | grep -v -F 'Exited (0)' | grep -c -F 'Exited ('
}
@ndrean
ndrean / nginx.conf
Created November 12, 2020 23:39 — forked from tompave/nginx.conf
commented nginx.conf for Ruby on Rails
# A commented nginx configuration file for Ruby on Rails
#
# Author: Tommaso Pavese
# [email protected]
# http://tommaso.pavese.me
#
# License: http://www.wtfpl.net/
#
#
# Tested with:
@ndrean
ndrean / contact-form.md
Created May 26, 2020 17:07 — forked from stevecondylios/contact-form.md
Tutorial: Create and Deploy a Contact Form to Production in Ruby on Rails 5

Create a Contact Form in Rails 5

This is a complete, step-by-step tutorial showing how to create a fully functional contact form in production in rails 5. Rather than reinvent things, the following borrows from the best available documentation and tutorials (most notably, this tutorial on making a contact form in development). The finished contact form can be viewed here.

This tutorial uses:

  • heroku for deployment,
  • gmail for the mailer, and
  • github for version control

It would be a good idea to create a new gmail account to use for your mailer now, if you haven't already. If you haven't yet got a heroku account and installed the heroku CLI, it would be easiest to do so now.

@ndrean
ndrean / RAILS_CHEATSHEET.md
Created December 22, 2019 21:50 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before