This file contains hidden or 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
tell application "Calendar" | |
-- Execute this script first manually via osascript Exchange_Sync.applescript to allow all security pop-ups. Make sure you use empty destination calendar because it will be wiped each run! | |
-- Don't forget to grant full calendar rights from System settings > Privacy & Security > Calendars > App > Options > Full calendar access | |
-- Schedule it via crontab -e and paste: "0 9,14 * * * osascript /Users/user.name/macOS_Cronjobs/Exchange_Sync.applescript > /Users/user.name/macOS_Cronjobs/cronjob.log" | |
-- Get the current date and time | |
set currentDate to current date | |
-- Set the start date range to 7 days ago | |
set startDateRange to currentDate - (7 * days) | |
-- Set the end date range to 30 days in the future | |
set endDateRange to currentDate + (30 * days) |
This file contains hidden or 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 scanpy as sc | |
import cupy as cp | |
from scipy.sparse import csr_matrix, find, issparse | |
from scipy.sparse.linalg import eigs | |
import numpy as np | |
import pandas as pd | |
import cudf | |
import glob | |
from cupy.sparse import cupyx as cpx | |
from cupyx.scipy.sparse import coo_matrix as coo_matrix_gpu |
This file contains hidden or 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 AMSgrad(Optimizer): | |
"""AMSGrad optimizer. | |
Default parameters follow those provided in the Adam paper. | |
# Arguments | |
lr: float >= 0. Learning rate. | |
beta_1: float, 0 < beta < 1. Generally close to 1. | |
beta_2: float, 0 < beta < 1. Generally close to 1. | |
epsilon: float >= 0. Fuzz factor. |
This file contains hidden or 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
""" | |
Simple example of manually performing "automatic" differentiation | |
""" | |
import numpy as np | |
from numpy import exp, sin, cos | |
def f(x, with_grad=False): | |
# Need to cache intermediates from forward pass (might not use all of them). | |
a = exp(x) |
This file contains hidden or 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 boto3 | |
# http://boto3.readthedocs.io/en/latest/reference/services/ec2.html#service-resource | |
ec2 = boto3.resource('ec2', aws_access_key_id='AWS_ACCESS_KEY_ID', | |
aws_secret_access_key='AWS_SECRET_ACCESS_KEY', | |
region_name='us-west-2') | |
# create VPC | |
vpc = ec2.create_vpc(CidrBlock='192.168.0.0/16') |
This file contains hidden or 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
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"> | |
</script> | |
<script> | |
$(document).ready(function(){ | |
var all_cells = $("div.cell"); | |
$.each(all_cells, function( index, value ) { | |
if ($(value).find("h1").length == 0){ | |
$(value).hide() | |
} else{ | |
var bare_h1 = $(value).find("h1").text() |
This file contains hidden or 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
#!/bin/bash | |
: ${NUM_FAILURES_ALLOWED:=10} | |
: ${SLEEP_PING_TIME:=10} | |
if [ "${1}" == "-c" -a -n "${2}" ]; then SHIMO_SCRIPT_CFG="${2}"; shift 2; fi | |
if [ -n "${SHIMO_SCRIPT_CFG}" ]; then | |
: ${SHIMO_HOME:="${HOME}/Library/Application Support/Shimo"} | |
: ${SHIMO_SCRIPT_HOME:="${SHIMO_HOME}/Scripts"} | |
: ${SHIMO_CONFIG_DIR:="${SHIMO_SCRIPT_HOME}/${SHIMO_SCRIPT_CFG}"} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
# Convert your notebook to an interactive webpage | |
# | |
# Attached a notebook (really-interactive-posts.ipynb) and the generated | |
# output (really-interactive-posts.html). The thebe.tpl template file is | |
# at the very end of the gist. | |
$ jupyter nbconvert --template thebe.tpl --to html <notebook.ipynb> | |
# You can open the generated webpage locally file://... howerver some |
This file contains hidden or 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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
NewerOlder