Skip to content

Instantly share code, notes, and snippets.

View bassemfg's full-sized avatar
💥

ML Wiz bassemfg

💥
View GitHub Profile
@drSeeS
drSeeS / rollingFuturesContract
Last active September 12, 2024 10:45
Class for constructing rolling futures contracts (at this time only using panama backadj. method on fixed calender days before maturity)
import datetime
import pandas as pd
from pandas.tseries.offsets import Day, BDay, DateOffset
import numpy as np
import os
import pickle
class rollingFuturesContract:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Frozenfire92
Frozenfire92 / gist:3627e38dc47ca581d6d024c14c1cf4a9
Last active December 15, 2024 08:15
Install Scala and SBT using apt-get on Ubuntu 16.04 or any Debian derivative using apt-get
## Java
sudo apt-get update
sudo apt-get install default-jdk
## Scala
sudo apt-get remove scala-library scala
sudo wget http://scala-lang.org/files/archive/scala-2.12.1.deb
sudo dpkg -i scala-2.12.1.deb
sudo apt-get update
sudo apt-get install scala
@vasanthk
vasanthk / System Design.md
Last active May 9, 2025 13:08
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 9, 2025 19:51
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@cburnette
cburnette / Upload file from local disk to a specific Box folder with auto-refreshing tokens using encrypted tokens in C#
Last active July 25, 2018 06:47
Upload file from local disk to a specific Box folder with auto-refreshing tokens using encrypted tokens in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Box.V2;
using Box.V2.Auth;
using Box.V2.Config;
using Box.V2.Exceptions;
using Box.V2.Models;
@cburnette
cburnette / Iterate Box folders in C#
Last active July 28, 2018 06:34
This code snippet will connect to a Box account and loop through all the folders recursively, printing out all the filenames, while highlighting in red files that have a modified_at date older than the specified threshold. In other words, it highlights files that haven't been changed in a while.
//requires .NET 4.5
using Box.V2;
using Box.V2.Auth;
using Box.V2.Config;
using Box.V2.Exceptions;
using Box.V2.Models;
using Nito.AsyncEx;
using System;
using System.Collections.Concurrent;
@crowdmatt
crowdmatt / s3-redshift-load.rb
Created April 26, 2013 00:25
Example of loading data into Amazon Redshift using redshift database adapter.
ActiveRecord::Base.connection.execute(
"copy campaign_events from 's3://BUCKET/FILEPATHPREFIX/' credentials 'aws_access_key_id=XXX;aws_secret_access_key=XXX' emptyasnull blanksasnull fillrecord delimiter '|'"
)
@nlarkin
nlarkin / Site Alerts Export.ps1
Created March 1, 2013 19:54
Powershell script with cycle through all available Sharepoint sites and export the alerts to a .csv file. Requires person executing to change the site url prior to running the script. Should be run from regular powershell window.
cls
$error.Clear()
##################################################################################################
# Load SharePoint Snapin
##################################################################################################
$snap = Get-PSSnapin | Where-Object {$_.Name -eq 'Microsoft.SharePoint.Powershell'}
if ($snap -eq $null) {
Write-Host "Loading Powershell Snapin..." -ForegroundColor Yellow
Add-PSSnapin Microsoft.SharePoint.Powershell