Skip to content

Instantly share code, notes, and snippets.

Santiago Castro bryant1410

Block or report user

Report or block bryant1410

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View conda-python
#!/usr/bin/env bash
set -e
if [[ $# -eq 0 ]]; then
echo "Illegal number of arguments. Usage: ${0} env_name_or_prefix [args]..."
exit 2
import time
import torch
import torch.nn as nn
from apex.normalization import FusedLayerNorm
torch.backends.cudnn.benchmark = True
bryant1410 /
Last active Nov 20, 2018
This script is a workaround to refresh the snaps under a NFS /home directory with root_squash option (the default).
#!/usr/bin/env bash
# This script is a workaround to refresh the snaps under a NFS /home directory with root_squash option (the default).
# Note that using no_root_squash is insecure.
# The bug was already filed:
set -ex
bryant1410 /
Created Jun 14, 2018
Load protobuf in tensorboard
# import tensorflow as tf
# from tensorflow.python.platform import gfile
# with tf.Session() as sess:
# model_filename ='aaa.pb'
# with gfile.FastGFile(model_filename, 'rb') as f:
# graph_def = tf.GraphDef()
# graph_def.ParseFromString(
# g_in = tf.import_graph_def(graph_def)
# LOGDIR='logsst2'
# train_writer = tf.summary.FileWriter(LOGDIR)
bryant1410 /
Last active Jan 24, 2017 — forked from robince/
Script to prepare arXiv package of a document that depends on a recent texlive version of biblatex (using pdflatex)
#!/usr/bin/env bash
# This script is useful if:
# - you have a manuscript that you want to upload to the arXiv,
# - you are using biblatex, and
# - you are using a recent version of texlive while arXiv is still on texlive2011
# Put this file in a directory containing the manuscript you want to
# upload to, and adapt the paths below.
bryant1410 /
Created Jul 12, 2016
Remove channels from Twilio IP Messaging
#!/usr/bin/env python3
import requests
# noinspection SpellCheckingInspection
# noinspection SpellCheckingInspection
# noinspection SpellCheckingInspection
AUTH_TOKEN = '...'
# Your init script
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
# An example hack to log to the console when each text editor is saved.
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
bryant1410 / mp4amp3
Created Nov 28, 2014
Convert all mp4 files to mp3 in current directory, deleting them
View mp4amp3
#!/usr/bin/env bash
# seen in
for filename in *.mp4
name=`echo "$filename" | sed -e "s/.mp4$//g"`
ffmpeg -i "$filename" -b:a 192K -vn "$name.mp3"
rm "$filename"
bryant1410 /
Last active Aug 29, 2015 — forked from kljensen/
This function helps to do a one hot encoding of a pandas' dataframe instead of a features numpy matrix. This has some advantages, for instance the fact of knowing which new columns have been created (identifying them easily).
# -*- coding: utf-8 -*-
""" Small script that shows hot to do one hot encoding
of categorical columns in a pandas DataFrame.
import pandas
import random
public String partToString() throws Exception {
javax.servlet.http.Part part;
try (java.util.Scanner scanner = new java.util.Scanner(part.getInputStream())) {
if (scanner.useDelimiter("\\A").hasNext()) {
} else {
return "";
You can’t perform that action at this time.