Skip to content

Instantly share code, notes, and snippets.

View syuraj's full-sized avatar
🏠
Working from home

Suraj Shrestha syuraj

🏠
Working from home
View GitHub Profile
@syuraj
syuraj / remove_github_stars.sh
Created December 16, 2023 02:59
remove_github_stars.sh
#!/usr/bin/env bash
# source: https://gist.github.com/justlaputa/a6da84981eca963817e652b5f2452cfc
set -o errexit
set -o pipefail
set -o nounset
STARS_PAGE_COUNT=20
STARS_FILE=stars.txt
DELETE_SLEEP_TIME=.5
@syuraj
syuraj / HTF-Candle.pine
Last active October 23, 2023 03:12
HTF Candle R1.2 by JustUncleL
//@version=5
indicator("HTF Candle R1.2 by JustUncleL", shorttitle="HTF Candle", overlay=true)
//
// Author: JustUncleL
// Date: 9-Nov-2017
// Version: R1.2
//
// Description:
@syuraj
syuraj / Backtrader_SuperTrend.py
Created September 20, 2023 02:46
Backtrader SuperTrend Indicator
class SuperTrend(bt.Indicator):
lines = ('super_trend',)
params = (
('multiplier', 12.0),
('atr_period', 3),
)
def __init__(self):
self.isDownTrend = -1
self.isUpTrend = 1
@syuraj
syuraj / Install-Spinnaker-Locally.md
Last active March 5, 2022 20:04
Install Spinnaker Locally (quick steps)

Notes: Install halyard, kubernetes (eg. docker-desktop from docker). Also need an aws account for storage (unless using minio)

  • Enable Kubernetes:
    • hal config provider kubernetes enable
  • Add account:
    • hal config provider kubernetes account add local-spinnaker --context docker-desktop
    • docker-desktop is local docker context
  • Enable artifacts:
    • hal config features edit --artifacts true
  • Set storage:
@syuraj
syuraj / Local-Spinnaker-using-Helm.md
Created March 5, 2022 19:36
Install Local Spinnaker using helm chart
To prevent wall messages from messing up all of your open terminals:
sudo systemctl stop systemd-ask-password-wall.service
sudo systemctl stop systemd-ask-password-wall.path
To make this change persistent over boot:
sudo systemctl mask systemd-ask-password-wall.service
sudo systemctl mask systemd-ask-password-wall.path
import { useState, useEffect } from 'react';
import { Storage } from '@ionic/storage';
const storage = new Storage();
storage.create();
export const useIonicStorage = (key, defaultValue) => {
const [value, setValue] = useState(defaultValue);
useEffect(() => {
@syuraj
syuraj / python_postgres_getting_started.py
Created June 20, 2020 03:34
Python Postgres Getting Started
import psycopg2
try:
connection = psycopg2.connect("postgres://postgres:@localhost:5432/postgres")
cursor = connection.cursor()
# create_table_query = '''CREATE TABLE mobile
# (ID INT PRIMARY KEY NOT NULL,
# MODEL TEXT NOT NULL,