Skip to content

Instantly share code, notes, and snippets.

View aquiseb's full-sized avatar

Sébastien aquiseb

View GitHub Profile
@aquiseb
aquiseb / pyrenko_optimization.py
Created April 7, 2025 13:31 — forked from lamres/pyrenko_optimization.py
Optimization function and routine
# Max index of train data
train_ind = round(stocks_close.shape[0] * 0.7)
# Function for optimization
def evaluate_renko(brick, history, column_name):
renko_obj = pyrenko.renko()
renko_obj.set_brick_size(brick_size = brick, auto = False)
renko_obj.build_history(prices = history)
return renko_obj.evaluate()[column_name]
@aquiseb
aquiseb / animated-continuous-sections-using-sliding-divs.markdown
Created November 14, 2022 12:54
Animated Continuous Sections Using Sliding divs

Nextjs Authentication with AWS Amplify

Install AWS Amplify @preview

yarn add aws-amplify@preview

# Optional
yarn add hoist-non-react-statics

React + Ant modular prompt approach

This example shows how to trigger a simple prompt, but with a very modular approach.

/* eslint-disable react/prop-types */
import * as React from 'react';
import styled from 'styled-components';

import { Popconfirm as PopconfirmAnt, Button } from 'antd';
@aquiseb
aquiseb / AWS-Lambda-Node-Sass.md
Last active July 24, 2020 01:02
Get node-sass bindings for your AWS Lambda deployment

AWS Lambda - Node-Sass

If you deployed your app to AWS Lambda with scss, you most got an error saying the node-sass bindings are missing.

Missing binding /opt/nodejs/node_modules/node-sass/vendor/linux-x64-64/binding.node\nNode Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x\n\nFound bindings for the following environments:\n - OS X 64-bit with Node.js 12.x\n\nThis usually happens because your environment has changed since running npm install.\nRun npm rebuild node-sass to download the binding for your current environment.

Solution

AWS Lambda requires linux-x64-64_binding.node. If you're coding on macOs or Windows, you won't have it. So here's the command to include in your deployment script.

Three.js React Hooks

This example shows how to use animate a cube and highly reuse each part of Three.js.

import * as React from "react";
import * as THREE from "three";

// WORLD SIZE
// ---
@aquiseb
aquiseb / 06.png
Created May 1, 2020 17:38 — forked from mfd/06.png
Gilroy font
06.png
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 60
Parameters:
Stage:
Type: String

AWS Cloudformation ApiGateway vs ApiGatewayV2 with Lambda

This shows how to convert a basic REST ApiGateway template to its equivalent HTTP ApiGatewayV2.

The original code before refactoring to ApiGatewayV2 comes from this article

Deployment

Replace MY_PROFILE, MY_REGION and MY_STACK_NAME

AWSTemplateFormatVersion: '2010-09-09'
Description: AWS API Gateway with a Lambda Integration
Parameters:
lambdaFunctionName:
Type: "String"
AllowedPattern: "^[a-zA-Z0-9]+[a-zA-Z0-9-]+[a-zA-Z0-9]+$"
Description: Lambda function name. (Recommend to keep default)
Default: "lambda-api"