Skip to content

Instantly share code, notes, and snippets.

View behrank's full-sized avatar
🍊

Behran Kankul behrank

🍊
View GitHub Profile
@behrank
behrank / btc_chart.py
Created July 14, 2024 12:37 — forked from kbagher/btc_chart.py
This code fetches historical BTC/USD data from Binance API, calculates various technical indicators such as moving averages, Bollinger Bands, MACD, RSI, and MFI, and generates a plot showing the BTC/USD price with these indicators. Based on these indicators, the code also generates a recommendation for whether to buy, sell, or hold BTC/USD.
import textwrap
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from mplfinance.original_flavor import candlestick_ohlc
import requests
import ta
from reportlab.pdfgen import canvas
@behrank
behrank / QueueExample.swift
Created March 6, 2020 08:54
Queue enum example
Queue.main.execute {
//Perform a task asynchronously
}
Queue.background.execute {
//Perform a background task
}
Queue.userInteractive.execute {
//Perform an userInteractive task
@behrank
behrank / Queue.swift
Last active March 6, 2020 08:53
Queue
import Foundation
protocol ExecutableQueue {
var queue: DispatchQueue { get }
}
extension ExecutableQueue {
func execute(closure: @escaping () -> Void) {
queue.async(execute: closure)
import UIKit
import RacoonKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//How to add subviews.
let firstView = UIView()
import UIKit
import RacoonKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//How to add subviews.
let firstView = UIView()
import UIKit
import RacoonKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//How to add subviews.
let firstView = UIView()
@behrank
behrank / API.swift
Last active August 29, 2015 14:09 — forked from higepon/API.swift
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
// YourProject-Bridging-Header.h
#import <FacebookSDK/FacebookSDK.h>
// AppDelegate.swift
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
.