Skip to content

Instantly share code, notes, and snippets.

@discdiver
discdiver / jupyterlab_shortcuts.md
Last active November 5, 2024 02:22
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@tvst
tvst / SessionState.py
Last active September 30, 2024 07:47
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
@sherdim
sherdim / plot_csd_erp.ipynb
Last active February 5, 2019 18:36
Current Source Density with mne-python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
/* rs-theme-name: One Dark */
/* rs-theme-is-dark: TRUE */
/* A port of Atom One Dark Theme */
.ace_gutter {
background: #282c34;
color: #464d5c
}
.ace_print-margin {
@samoshkin
samoshkin / postman_vs_insomnia_comparison.md
Created November 6, 2018 17:42
Comparison of API development environments: Postman vs Insomnia

Postman vs Insomnia comparison

Postman | API Development Environment https://www.getpostman.com
Insomnia REST Client - https://insomnia.rest/

Features                                        Insomnia Postman Notes
Create and send HTTP requests x x
Authorization header helpers x x Can create "Authorization" header for you for different authentication schemes: Basic, Digest, OAuth, Bearer Token, HAWK, AWS
@mbjoseph
mbjoseph / zoib-recovery.R
Created November 27, 2017 07:33
Simulation for zero-one inflated beta regression in Stan
## DATA GENERATION
# reproducibility
library(bayesplot)
set.seed(1839)
# matches the stan function
inv_logit <- function(x){
exp(x) / (1 + exp(x))
}
@jobonaf
jobonaf / app.R
Created June 22, 2017 12:35
shiny app redirection
server <- function(input, output, session) {}
ui <- fluidPage(singleton(tags$head(tags$script('window.location.replace("https://sdati.arpae.it/calicantus-intro");'))))
shinyApp(ui = ui, server = server)
@adam-garcia
adam-garcia / README.md
Last active April 23, 2024 09:41
Viridis Color Palette Generator

Viridis Color Palette Generator

A simple tool for extracting discrete color palette values from the viridis collection of color palettes.

@adamabernathy
adamabernathy / linspace.js
Created December 2, 2016 17:30
Creates a linearly spaced array
/**
* Create a linearly spaced array
*
* @param {number} start - starting integer
* @param {number} nvalues - how many values
* @param {number} interval - interval (optional)
*/
function __linspace(start, nvalues, interval) {
if (typeof interval === "undefined") { interval = 0; }
var i;
@edeno
edeno / parSave.m
Last active November 16, 2018 03:21
Matlab wrapper function for save for use in parfor loops
% Wrapper function for save for use in parfor loops
% Based on http://www.mathworks.com/matlabcentral/answers/135285#answer_149537
% Handles save options such as -append
%
% Test Example 1
% a = 10;
% b = 'blah';
% c.test = 1;
% d = {'a'};
% e = [100 100];