Skip to content

Instantly share code, notes, and snippets.

View dryleaf's full-sized avatar
🎧
Listen, can you hear it?

Josimar Lopes dryleaf

🎧
Listen, can you hear it?
View GitHub Profile
@dryleaf
dryleaf / hde_challenge.go
Last active May 27, 2018 23:00
HDE programming challenge
package main
import (
"fmt"
"bytes"
"strconv"
)
func main() {
var N int
https://machinelearningmastery.com/how-to-evaluate-machine-learning-algorithms/
https://en.wikipedia.org/wiki/Cross-validation_(statistics)
@dryleaf
dryleaf / device-detection.css
Last active October 24, 2019 01:36
css device type detection (using ios `@supports`)
/* start ios/android device detection */
.supports-ios {
display: none;
}
.supports-android {
display: block;
}
@supports (-webkit-overflow-scrolling: touch) {
.supports-ios {
display: block;

1. Adding webpack bundle analyzer to NextJs app (Production)

a) Install webpack bundle analyzer as a dev dependancy

npm install --save-dev webpack-bundle-analyzer

or

yarn add -D webpack-bundle-analyzer
@dryleaf
dryleaf / python_trader_for_medium_article_v1.py
Created April 16, 2021 14:46 — forked from pacarvalho/python_trader_for_medium_article_v1.py
Simple python script for trading currency pair on forex.com
from gcapi import GCapiClient # From https://github.com/rickykim93/gcapi-python
from gcapi.gcapi_tools import format_date # From https://github.com/rickykim93/gcapi-python
from datetime import datetime
from time import sleep
import numpy
def check_sell_criteria(prices):
# TODO: Write your algorithm to detect sell condition here
return False
@dryleaf
dryleaf / README.md
Created April 30, 2021 23:41 — forked from sithuwin93/README.md
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@dryleaf
dryleaf / next_nginx.md
Created June 13, 2021 11:51 — forked from joelmasters/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt/getssl

next.js, nginx, reverse-proxy, ssl

Next.js package setup

Your server.js file should look like the following. Make sure you're serving static files!

const { createServer } = require('http');
const { parse } = require('url');
const next = require('next');
@dryleaf
dryleaf / next_nginx.md
Created June 18, 2021 11:52 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

#!/bin/bash
## Conventions:
##
## Working directory has the same name as the s3 bucket.
## Script is executed from the parent of this directory.
##
BUCKET=$1
@dryleaf
dryleaf / install-docker.sh
Created April 3, 2022 06:59 — forked from shivekkhurana/install-docker.sh
Install Docker and Docker Compose on a Ubuntu Machine (Tested on AWS)
#!/bin/sh
set -eu
# Docker
sudo apt remove --yes docker docker-engine docker.io || true
sudo apt update
sudo apt --yes --no-install-recommends install apt-transport-https ca-certificates
wget --quiet --output-document=- https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -