Skip to content

Instantly share code, notes, and snippets.

View DandiestSquare1's full-sized avatar

DandiestSquare1 DandiestSquare1

View GitHub Profile
@ianchesal
ianchesal / README.md
Last active August 13, 2023 13:50
Migrating NightScout site from Heroku to Render.com

Migrating NightScout from Heroku to Render.com

!!!! Attention !!!!

These are mostly my rough notes on the process I followed to migrate my NightScout site from Heroku to Render.

They have not been rigorously tested or attempted more than the one time I migrated.

I'm using NightScout with a Dexcom setup. I have no idea if these instructions will work for any other CGM setup.

@jindrichmynarz
jindrichmynarz / dub_techno_in_sonic_pi.rb
Created December 8, 2015 19:11
Dub techno in Sonic Pi
use_debug false
use_bpm 130
# Our mixer!
master = (ramp *range(0, 1, 0.01))
kick_volume = 1
bass_volume = 1
revbass_volume = 1
snare_volume = 0.5
hats_volume = 0.5
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mahmoodkhan
mahmoodkhan / google_spreadsheet2.py
Created January 27, 2015 01:28
google spreadsheet djagno api spreadsheet_api oauth
from oauth2client.client import flow_from_clientsecrets
from oauth2client.django_orm import Storage
from oauth2client import xsrfutil
from django.conf import settings
from django.views.decorators.csrf import csrf_protect
from .models import GoogleCredentialsModel
from apiclient.discovery import build
import os, logging, httplib2, json, datetime
import gdata.spreadsheets.client
@MrFlick
MrFlick / makeglm.R
Last active October 7, 2023 11:28
makeglm.R: Creates a "fake" glm object with specific coefficients that you can use for predicting without fitting a model first
makeglm <- function(formula, ..., family, data=NULL) {
dots <- list(...)
out<-list()
tt <- terms(formula, data=data)
if(!is.null(data)) {
mf <- model.frame(tt, data)
vn <- sapply(attr(tt, "variables")[-1], deparse)
if((yvar <- attr(tt, "response"))>0)
vn <- vn[-yvar]
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs