This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud projects create ${project_id} --organization={organization_id} | |
gcloud beta billing projects link ${project_id} --billing-account ${account_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud projects create ${project_id} | |
gcloud beta billing projects link ${project_id} --billing-account ${account_id} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge(self, intervals): | |
out = [] | |
for i in sorted(intervals, key=lambda i: i.start): | |
if out and i.start <= out[-1].end: | |
out[-1].end = max(out[-1].end, i.end) | |
else: | |
out += i, | |
return out | |
class Solution: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
import time | |
import bs4 | |
from jinja2 import Template | |
from collections import OrderedDict | |
from bokeh.embed import components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class clsproperty(object): | |
"""A data descriptor that sets and returns values | |
normally and prints a message logging their access. | |
""" | |
def __init__(self, fget=None, fset=None, fdel=None, doc=None): | |
self.fget = fget | |
self.fset = fset | |
self.fdel = fdel | |
if doc is None and fget is not None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_registry_metaclass(registry_name, class_name="MetaRegistry"): | |
registration_method_name = 'register_class' | |
def new(meta, name, bases, class_dict): | |
cls = type.__new__(meta, name, bases, class_dict) | |
if name not in getattr(meta, registry_name): | |
getattr(meta, registration_method_name)(getattr(meta, registry_name), cls) | |
return cls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MetaRegistry(type): | |
class_registry = {} | |
def __new__(meta, name, bases, class_dict): | |
cls = type.__new__(meta, name, bases, class_dict) | |
if name not in meta.class_registry: | |
meta.register_class(meta.class_registry, cls) | |
return cls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Anaconda | |
export PATH=:/Users/nicholasc/anaconda3/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/nicholasc/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlueColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGKyxYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKcHCBMZHSQoVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T | |
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPEB8wLjIxNTY4NjI3 | |
NDUgMC40IDAuNjM1Mjk0MTE3NiAxTxAnMC4xNjc0NzA0NTUyIDAuMzE3Njg1MTg2OSAw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from allensdk.internal.api.mtrain_api import MtrainApi | |
from allensdk.internal.api.behavior_lims_api import BehaviorLimsApi | |
from allensdk.brain_observatory.behavior.behavior_session import BehaviorSession | |
from allensdk.brain_observatory.behavior.behavior_api.behavior_nwb_api import BehaviorNwbApi | |
bl_api = BehaviorLimsApi() | |
m_api = MtrainApi() | |
# Get a session: |
NewerOlder