Discover gists
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
[Unit] | |
Description=mongodb | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Restart=always | |
RestartSec=5s | |
TimeoutStartSec=0 | |
KillMode=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
#cloud-config | |
coreos: | |
units: | |
- name: format-drive.service | |
command: start | |
content: | | |
[Unit] | |
Description=Formats the drive | |
After=dev-xvdc.device |
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
ENV PHANTOMJS_VERSION=1.9.8 | |
RUN \ | |
cd /usr/local && \ | |
curl -fLO https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 && \ | |
tar --strip-components 1 -xjf phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs && \ | |
rm phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 |
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
dm() { | |
status=$(docker-machine status dev) | |
if [ $? -ne 0 ]; then | |
echo "Got an error trying to get VM status" | |
return | |
fi | |
case $status in | |
Stopped) |
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
package iterator | |
type Iterator interface { | |
Next() (value interface{}, done bool, err error) | |
} |
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
{ | |
"properties" : { | |
"name" : "Ayer", | |
"geometry" : { | |
"lat" : 42.56, | |
"lng" : -71.58 | |
}, | |
"city" : "Ayer", | |
"state" : "MA", | |
"zipcode" : "01432" |
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
RUN \ | |
curl -sfLO http://www.imagemagick.org/download/ImageMagick-6.9.0-4.tar.gz && \ | |
echo 'cf51a1c6ebf627c627a8e6ac20aecce5f1425907c2cdb98c5a60f329c5c6caf2 ImageMagick-6.9.0-4.tar.gz' | sha256sum -c - && \ | |
tar -xzf ImageMagick-6.9.0-4.tar.gz && \ | |
cd ImageMagick-6.9.0-4 && \ | |
./configure --prefix /usr/local && \ | |
make install && \ | |
cd .. && \ | |
rm -rf ImageMagick* |
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
const mdColors = [ | |
'#F44336', | |
'#FFEBEE', | |
'#FFCDD2', | |
'#EF9A9A', | |
'#E57373', | |
'#EF5350', | |
'#F44336', | |
'#E53935', | |
'#D32F2F', |
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
# Inspired by: https://towardsdatascience.com/the-one-pytorch-trick-which-you-should-know-2d5e9c1da2ca. | |
# Monkey patching idea suggested by @kklemon here: | |
# https://gist.github.com/airalcorn2/50ec06517ce96ecc143503e21fa6cb91?permalink_comment_id=4407423#gistcomment-4407423. | |
import torch | |
from torch import nn | |
def patch_attention(m): |
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
# action.yml | |
name: 'Hello World' | |
description: 'Run tests' | |
runs: | |
using: 'docker' | |
# this corresponds to the location of the dockerfile, relative to your action's folder (automatic-tests here) | |
image: '../../../Dockerfile' |
NewerOlder