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
#include <iostream> | |
#include <cuda_runtime.h> | |
#include <cudnn.h> | |
/** | |
* Minimal example to apply sigmoid activation on a tensor | |
* using cuDNN. | |
**/ | |
int main(int argc, char** argv) |
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
function bionifyPage(){ | |
function bionifyWord(word) { | |
if (word.length == 1) { | |
return word; | |
} | |
var numBold = Math.ceil(word.length * 0.3); | |
// return "<div class=\"bionic-highlight\">" + word.slice(0, numBold) + "</div>" + + "<div class=\"bionic-rest\">" + word.slice(numBold) + "</div>"; | |
return "<b>" + word.slice(0, numBold) + "</b>" + "<span>" + word.slice(numBold) + "</span>"; | |
} |
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 numpy as np | |
SIZE = 500000 | |
meta = {} | |
first = np.random.random(SIZE) | |
meta["first"] = {"git id": "yay this is a string"} | |
second = np.random.random(SIZE) | |
meta["second"] = {"git id": "yay this is a string"} | |
third = np.random.random(SIZE) |
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 numpy as np | |
import h5py | |
SIZE = 500000 | |
with h5py.File("test.hdf", "w") as f: | |
f["first"] = np.random.random(SIZE) | |
f["first"].attrs["git id"] = "yay this is a string" | |
f["second"] = np.random.random(SIZE) | |
f["second"].attrs["git id"] = "yay this is a string" |
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 structlog | |
def _add_log_level_upper(logger, method_name, event_dict): | |
event_dict["level"] = method_name.upper()[0] | |
return event_dict | |
level_styles = structlog.dev.ConsoleRenderer.get_default_level_styles() | |
new_styles = {} |
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
#!/usr/bin/env python | |
import hashlib | |
import optparse | |
import paramiko | |
from Crypto.PublicKey import RSA | |
def insert_char_every_n_chars(string, char='\n', every=64): | |
return char.join( |
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 troposphere import \ | |
AWSHelperFn, Base64, Cidr, Condition, Equals, GetAtt, Join, Not, Output, Parameter, Ref, \ | |
Region, Select, Split, StackName, Sub, Tags, Template | |
from troposphere.autoscaling import \ | |
AutoScalingGroup, LaunchTemplateSpecification, LifecycleHookSpecification | |
from troposphere.awslambda import \ | |
Code, Function, Permission | |
from troposphere.ec2 import \ | |
CreditSpecification, IamInstanceProfile, InternetGateway, LaunchTemplate, LaunchTemplateData, \ | |
Route, RouteTable, SecurityGroup, SecurityGroupRule, Subnet, SubnetRouteTableAssociation, VPC, \ |
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
#!/bin/bash | |
# https://gist.github.com/gcchaan/ad8fd83a68467503ec3e6392ebbd519a | |
set -ef -o pipefail | |
function message(){ | |
echo 🍣 "$1" | |
} | |
function help(){ |
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
{ | |
"AWSEBDockerrunVersion": "1", | |
"Authentication": { | |
"Bucket": "bucket_name", | |
"Key": "docker/dockercfg" | |
}, | |
"Image": { | |
"Name": "company/<image>" | |
}, | |
"Ports": [ |
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 os | |
import json | |
import hashlib | |
import datetime | |
from database import db | |
from sqlalchemy import event | |
def literal_sql(context): |
NewerOlder