Skip to content

Instantly share code, notes, and snippets.

View philiporlando's full-sized avatar
🏔️

Philip Orlando philiporlando

🏔️
View GitHub Profile
@prakharcode
prakharcode / QGIS-install.md
Last active January 10, 2024 06:10
Install QGIS 3
cd /etc/apt/
sudo vim sources.list



# paste the following

# QGIS 3 install
deb https://qgis.org/ubuntu-ltr/ bionic main
@a-r-d
a-r-d / hold-tlt-version.py
Last active May 18, 2021 13:40
QuantConnect - simple MACD strategy against SPY, 50/150 day cross, long and short, leverage is none
import numpy as np
### <summary>
### Basic template algorithm simply initializes the date range and cash. This is a skeleton
### framework you can use for designing an algorithm.
### </summary>
class BasicTemplateAlgorithm(QCAlgorithm):
'''Basic template algorithm simply initializes the date range and cash'''
def Initialize(self):
@tgirke
tgirke / _Nvim-R-Tmux.md
Last active October 13, 2023 05:29
Nvim-R-Tmux: An Integrated Working Environment for R

Nvim-R-Tmux: Neovim-based IDE for R

!!! This Gist tutorial is deprecated. Its new version is available here !!!

This is some red text.

  • Author: Thomas Girke
  • Last update: 18-Nov-2020

@johnbaums
johnbaums / gdal_mean.R
Last active July 15, 2021 19:04
Fast calculation of cellwise mean across a raster stack, using gdal_calc.py
gdal_mean <- function(infile, outfile, return_raster=FALSE, overwrite=FALSE) {
# Be aware that the outfile type will be the same as the infile type
require(rgdal)
if(return_raster) require(raster)
# infile: The multiband raster file (or a vector of paths to multiple
# raster files) for which to calculate cell mean.
# outfile: Path to raster output file.
# return_raster: (logical) Should the output raster be read back into R?
# overwrite: (logical) Should outfile be overwritten if it exists?
gdal_calc <- Sys.which('gdal_calc.py')
@dsparks
dsparks / Avoiding a loop.R
Created September 12, 2012 13:19
lapply() as an alternative to a multiply-nested loop
# Alternative to a doubly-nested loop
# Imagine I want to perform an operation on a data frame
# once for each combination of two variables, such as Country and Year
# I can do this with a nested loop, or I can do this with (among other
# things) lapply()
# Generate random data:
allCountries <- LETTERS[1:10]
allYears <- 1990:2012
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 3, 2024 19:09
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname