Skip to content

Instantly share code, notes, and snippets.

View munyari's full-sized avatar

Panashe Fundira munyari

View GitHub Profile
@munyari
munyari / typescript.snippets
Created March 2, 2018 13:29
Some ultisnips snippets for react in typescript
snippet cdm
componentDidMount() {
${0}
}
snippet cdup
componentDidUpdate(${1:prevProps,} ${2:prevState}) {
${0}
}
snippet cwm
componentWillMount() {
#
# /etc/makepkg.conf
#
#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
# Format: 'protocol::agent'
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
What I did today:
- Refactored my [backup script](https://gist.github.com/9dad2f5112554a3857e93511a133d5bc) to include pushover notifications and move everything into functions
#!/usr/bin/env bash
set -o errexit # Exit on most errors
set -o nounset # Dissallow expansion of unset variables
DISK=/media/backup
export BORG_PASSPHRASE="$(pass borg)"
BORG_REPOSITORY="$DISK/borg"
# DESC: notify the user that backups are done
This file has been truncated, but you can view the full file.
2017-03-15 20:05:28,278 INFO - Starting experiment h7WfJPsPtbLc2NTZcx8zrX
2017-03-15 20:05:28,290 INFO - Using cached TaskInstance <TaskInstance: floydhub/cats-vs-dogs (id: FQu8MRvj5RYkwPeCLCCdpR) (checksum: 8e5e9a6b37ae45b65a49bfb4f53461ed) (last update: 2017-03-15 19:06:42.555511) [success]>
2017-03-15 20:05:28,387 INFO - Sending <TaskInstance: munyari/cats-dogs:50 (id: y4pY4Z4HiaTXMquPe7ddb7) (checksum: 0f0e7ccc7139aa4e5c183db40be43d46) (last update: 2017-03-15 20:05:28.351627) [None]> to celery
2017-03-15 20:05:31,537 INFO - Task instance y4pY4Z4HiaTXMquPe7ddb7 is still in state: running
2017-03-15 20:05:31,538 INFO - [experiment progress] | waiting: 1 | succeeded: 1 | kicked off: 1 | failed: 0 | deadlocked: 0
2017-03-15 20:05:35,653 INFO - Task instance y4pY4Z4HiaTXMquPe7ddb7 is still in state: running
2017-03-15 20:05:35,653 INFO - [experiment progress] | waiting: 1 | succeeded: 1 | kicked off: 1 | failed: 0 | deadlocked: 0
2017-03-15 20:05:39,772 INFO - Task instance y4pY4Z4HiaTXMquPe7ddb7 is still in
2017-03-15 20:05:28,431 INFO - Preparing to run TaskInstance <TaskInstance: munyari/cats-dogs:50 (id: y4pY4Z4HiaTXMquPe7ddb7) (checksum: 0f0e7ccc7139aa4e5c183db40be43d46) (last update: 2017-03-15 20:05:28.396849) [queued]>
2017-03-15 20:05:28,451 INFO - Starting attempt 1 at 2017-03-15 20:05:28.438673
2017-03-15 20:05:28,823 INFO - Executing command in container: stdbuf -o0 sh command.sh
2017-03-15 20:05:28,824 INFO - Pulling Docker image: floydhub/tensorflow:latest-gpu-py2
2017-03-15 20:05:31,676 INFO - Starting container...
2017-03-15 20:05:32,861 INFO -
################################################################################
2017-03-15 20:05:32,861 INFO - Run Output:
2017-03-15 20:18:19,192 INFO - Using TensorFlow backend.
2017-03-15 20:04:49,273 INFO - Preparing to run TaskInstance <TaskInstance: munyari/cats-dogs:49 (id: J3PHVrEZzjYAfp6THbaVfn) (checksum: 481cad7c140aaebf6f3e857b29f25813) (last update: 2017-03-15 20:04:49.233048) [queued]>
2017-03-15 20:04:49,282 INFO - Starting attempt 1 at 2017-03-15 20:04:49.276406
2017-03-15 20:04:49,549 INFO - Executing command in container: stdbuf -o0 sh command.sh
2017-03-15 20:04:49,549 INFO - Pulling Docker image: floydhub/tensorflow:latest-gpu-py3
2017-03-15 20:04:50,735 INFO - Starting container...
2017-03-15 20:04:51,006 INFO -
################################################################################
2017-03-15 20:04:51,006 INFO - Run Output:
2017-03-15 20:09:35,371 INFO - I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
2017-03-15 19:29:40,962 INFO - Preparing to run TaskInstance <TaskInstance: munyari/cats-dogs:48 (id: Bb2AzPHniXPvVkLtXGAkem) (checksum: 608fba09501cdec4356edfc7673992cd) (last update: 2017-03-15 19:29:40.890385) [queued]>
2017-03-15 19:29:40,972 INFO - Starting attempt 1 at 2017-03-15 19:29:40.966058
2017-03-15 19:29:41,243 INFO - Executing command in container: stdbuf -o0 sh command.sh
2017-03-15 19:29:41,243 INFO - Pulling Docker image: floydhub/theano:latest-gpu-py2
2017-03-15 19:29:42,464 INFO - Starting container...
2017-03-15 19:29:42,743 INFO -
################################################################################
2017-03-15 19:29:42,744 INFO - Run Output:
2017-03-15 19:34:18,976 INFO - Using Theano backend.
#!/usr/bin/env python3
import os
from glob import glob
from shutil import copyfile, copytree, rmtree
import numpy as np
def mkdir(path):
os.makedirs(path, exist_ok=True)
cd = os.chdir