Skip to content

Instantly share code, notes, and snippets.

@onatcipli
onatcipli / go_router_example.dart
Last active July 8, 2024 03:49
go_router_example.dart
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
main() {
CustomNavigationHelper.instance;
runApp(const App());
}
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@jauderho
jauderho / gist:6b7d42030e264a135450ecc0ba521bd8
Last active July 18, 2024 16:11
HOWTO: Upgrade Raspberry Pi OS from Bullseye to Bookworm
### WARNING: READ CAREFULLY BEFORE ATTEMPTING ###
#
# Officially, this is not recommended. YMMV
# https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/
#
# This mostly works if you are on 64bit. You are on your own if you are on 32bit or mixed 64/32bit
#
# Credit to anfractuosity and fgimenezm for figuring out additional details for kernels
#
@devinderaujla
devinderaujla / cloudflare-ddns-update.sh
Last active March 31, 2024 16:21 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# based on https://gist.github.com/Tras2/cba88201b17d765ec065ccbedfb16d9a
# initial data; they need to be filled by the user
#### Added multiple sub domains and proxy state set options
## API token; e.g. FErsdfklw3er59dUlDce44-3D43dsfs3sddsFoD3
api_token=<>
## the email address associated with the Cloudflare account; e.g. email@gmail.com
email=<>
## the zone (domain) should be modified; e.g. example.com
zone_name=example.com
@larsks
larsks / boot.sh
Created September 6, 2022 02:24
Booting raspberry pi 64 bit using qemu
#!/bin/sh
SERIAL1=( -chardev stdio,id=uart1 -serial chardev:uart1 -monitor none )
SERIAL2=( -serial vc -serial vc )
SERIAL3=( -nographic -serial mon:stdio )
EMU_RASPI=( -M raspi3 )
EMU_VIRT=( -M virt -cpu cortex-a72 )
NET_TAP=(
@maheshj01
maheshj01 / bottomnavbar.dart
Last active September 2, 2023 11:53
Demo app for a medium post "Everything about the Nested bottom navigation bar"
/*
* File: main.dart
* Project: BottomNavigationBar demo
* File Created: Wednesday, 26th May 2022 1:15:47 pm
* Author: Mahesh Jamdade
* -----
* Last Modified: Saturday, 28th May 2022 4:42:07 pm
* Modified By: Mahesh Jamdade
* -----
*/
@jooosh
jooosh / cloudflare_ddns_update.sh
Last active January 30, 2024 02:38 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
zone=example.com
# dnsrecord is the A record which will be updated
@18182324
18182324 / pairs-trading-advanced-strategy
Created November 14, 2021 10:01
Pairs Trading Advanced K-Means Algorithm Clustering
companies_dict = {
'Amazon':'AMZN',
'Apple':'AAPL',
'Walgreen':'WBA',
'Northrop Grumman':'NOC',
'Boeing':'BA',
'Lockheed Martin':'LMT',
'McDonalds':'MCD',
'Intel':'INTC',
'Navistar':'NAV',
@Component({
template: `
<h1 [style.--color]="color">CSS vars works!</h1>
`,
styles: [
`
h1 {
color: var(--color);
}
`
@18182324
18182324 / Pairs Trading Strategy Backtest for copula method [Python Code]
Last active February 7, 2023 02:57
Pairs Trading Strategy Backtest for copula method [Python Code]
import numpy as np
from scipy import stats
from statsmodels.distributions.empirical_distribution import ECDF
from scipy.stats import kendalltau, pearsonr, spearmanr
from scipy.optimize import minimize
from scipy.integrate import quad
import sys
from collections import deque