Skip to content

Instantly share code, notes, and snippets.

View DoubleCouponDay's full-sized avatar

DoubleCouponDay DoubleCouponDay

  • Spida Machinery
  • New Zealand
  • 17:10 (UTC +13:00)
View GitHub Profile
const ccxt = require('ccxt');
const colors = require('colors');
const moment = require('moment-timezone');
const exchanges = {
bittrex: new ccxt.bittrex(),
binance: new ccxt.binance()
};
const percentChange = (oldPrice, newPrce) => {
return ((newPrce - oldPrice) / oldPrice) * 100;
};
@tystol
tystol / CascadeDeleteAttribute.cs
Last active October 26, 2022 21:55
Entity Framework CascadeDelete using Data Annotations
using System;
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class CascadeDeleteAttribute : Attribute { }
@davidmarble
davidmarble / patch_model.py
Created November 28, 2011 21:02
Monkey patch django built-in models so that any fields can be overwritten or added
from django.db.models.fields import Field
import types
def patch_model(model_to_patch, class_to_patch_with):
"""
Adapted from http://www.ravelsoft.com/blog/2010/patchmodel-hacky-solution-extending-authuser-class
Monkey patch a django model with additional or replacement fields and methods.
All fields and methods that didn't exist previously are added.