Skip to content

Instantly share code, notes, and snippets.

@florentroques
florentroques / Full Stack JavaScript.md
Last active November 21, 2021 07:30
Learn Full Stack JavaScript Web Development for FREE using resources like YouTube, Udacity and NodeSchool
#!/bin/bash
checkExisting(){
echo "Checking if already existing device on file..."
while read fileLine; do
if [ "$line" = "$fileLine" ]; then
echo "[WARNING] Device already initialized on this system. Nothing to do here"
  • Data aggregation is the grouping of data in summary form.
  • Daily Count is the count of orders in a day.
  • Daily Revenue Count is the revenue on orders per day.
  • Product Sum is the total revenue of a product.
  • Subqueries can be used to perform complicated calculations and create filtered or aggregate tables on the fly.
  • Reorder Rate is the ratio of the total number of orders to the number of people making orders.

#Good practices

  • package.json:
    • give the exact version of a script
    • gitignore node_modules directory

##Packages to use

  • mongoose: writing MongoDB validation, casting and business logic boilerplate
  • express: launch a web server
  • superagent: test http requests

##Handle width and max-width To oblige elements to fit parent container, put max-width:100%

img, embed, object, video {
  max-width:100%;
}

max-width overrides width and forces an element to fix a container

@florentroques
florentroques / immutable-libraries.md
Created December 17, 2016 02:22 — forked from jlongster/immutable-libraries.md
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

https://medium.com/@derrickburns/building-a-modern-scalable-backend-modernizing-monolithic-applications-15fc3b8101fa#.eod0571mn

Building A Modern, Scalable Backend: Modernizing Monolithic ApplicationsOne year ago my consultancy was hired to construct a modern backend for a travel site that serves millions of unique visitors each month after the previous team had failed. This is the story of our success.The ProblemIf your business is based on content, then you must solve two separate problems: 1) how to create new content and 2) how to serve content via your web site, via your mobile applications, and perhaps via third parties. If your business has tenure, then your content creation suite

@florentroques
florentroques / index.html
Created January 15, 2017 15:28 — forked from jazzido/index.html
Webcam barcode reading (zbar, emscripten)
<!DOCTYPE html>
<html>
<head>
<title>JS in-browser barcode reader</title>
<style type="text/css">
body > div {
position: relative;
width: 320px; height: 240px;
}
video { position: absolute; top: 0; left: 0; width: 320px; height: 240px; }
ffmpeg -i video.MOV -acodec copy -f segment -segment_time 10 -vcodec copy -reset_timestamps 1 -map 0 video-part%d.MOV