Skip to content

Instantly share code, notes, and snippets.

View louisrli's full-sized avatar

Louis louisrli

View GitHub Profile
@Ammar-64
Ammar-64 / e-commerce.md
Last active October 13, 2020 15:59
e-commerce project (istanbul bootcamp 3)

e-commerce project

During the course of the coming weeks, we'll be building the new better Amazon, it’s better because you’ll build it

Requirement:

  • Products page that displays a list/grid of products
  • Single product page that displays the details of a single product
  • Cart component wherre the user can add items in order to check them out later (using context API to move the state of the items to the cart)
  • Implementation of react-router to navigate between pages
  • Authentication where a specific user can sign in/up and see his products in the cart
  • The data should be coming from firebase and changes there when an item has been checked out.
@badsyntax
badsyntax / vscode-grpc.md
Last active November 16, 2023 23:17
The problem with using grpc in a vscode extension

Background

I'm using websockets & protobuf in my vscode extension. I want to replace the message abstractions & inconsistent code with a nicely defined server/client interface using grpc.

The Problem

After working on some POC code and running the extension for the first time, I was faced with the following error:

Activating extension 'richardwillis.vscode-gradle' failed: 
@rstml
rstml / crop.md
Last active June 9, 2023 06:02
Keras center and random crop support for ImageDataGenerator

Keras center and random crop support for ImageDataGenerator

preprocess_crop.py script below adds center and random crop to Keras's flow_from_directory data generator.

It first resizes image preserving aspect ratio and then performs crop. Resized image size is based on crop_fraction which is hardcoded but can be changed. See crop_fraction = 0.875 line where 0.875 appears to be the most common, e.g. 224px crop from 256px image.

Note that the implementation has been done by monkey patching keras_preprocessing.image.utils.loag_img function as I couldn't find any other way to perform crop before resizing without rewriting many other classes above.

Due to these limitations, the cropping method is enumerated into the interpolation field. Methods are delimited by : where the first part is interpolation and second is crop e.g. lanczos:random. Supported crop methods are none, center, random. When no crop method is specified, none is assumed.

const { GraphQLServer } = require("graphql-yoga");
const session = require("express-session");
const { Prisma } = require("prisma-binding");
const resolvers = require("./resolvers");
const db = new Prisma({
typeDefs: "src/generated/prisma.graphql", // the auto-generated GraphQL schema of the Prisma API
endpoint: process.env.PRISMA_ENDPOINT, // the endpoint of the Prisma API (value set in `.env`)
debug: true // log all GraphQL queries & mutations sent to the Prisma API
// secret: process.env.PRISMA_SECRET, // only needed if specified in `database/prisma.yml` (value set in `.env`)
@juliandunn
juliandunn / postgresql-on-aws-tips.md
Last active September 27, 2022 10:55
Notes on PostgreSQL performance optimization on RDS

Deep Dive: PostgreSQL on AWS

When loading data

  • disable backups (backup_retention=0)
  • disable multi-AZ and autovacuum
  • pg_dump -Fc (compressed) and pg_restore -j (parallel)
  • Increase maintenance_work_mem
@nodesocket
nodesocket / bootstrap.flatten.css
Last active April 1, 2021 23:37
Below are simple styles to "flatten" bootstrap. I didn't go through every control and widget that bootstrap offers, only what was required for https://commando.io, so your milage may vary.
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 22, 2024 04:43
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jgarber
jgarber / MIT-LICENSE.txt
Created April 4, 2012 14:57
Responsive video
Copyright (c) 2011 ZURB, http://www.zurb.com/