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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
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 | |
#MEM_LIMIT="" | |
if [ $# -lt 1 ]; then | |
echo "Usage: $0 <program_to_test> [args...]" | |
fi | |
SELF="$(readlink -f "$0")" |
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
SELECT | |
'DROP INDEX "'||nspname||'"."'||relname||'" RESTRICT;' | |
FROM pg_index | |
INNER JOIN pg_class ON indexrelid=pg_class.oid | |
INNER JOIN pg_namespace ON pg_namespace.oid=pg_class.relnamespace | |
WHERE indrelid = (SELECT oid FROM pg_class WHERE relname='??') | |
AND indisprimary=FALSE | |
AND indisvalid=TRUE | |
AND nspname NOT LIKE 'pg_%25' | |
ORDER BY nspname,relname; |
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
x |
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
# wallpaper | |
wget "https://wp-cdn-2.s3.amazonaws.com/wp-content/uploads/2018/01/sigmoidal-logo.png" -O ~/wallpaper.png | |
gsettings set org.gnome.desktop.background picture-uri "file://$HOME/wallpaper.png" | |
gsettings set org.gnome.desktop.background picture-options 'centered' | |
gsettings set org.gnome.desktop.background primary-color '#ffffffffffff' | |
# software | |
sudo apt-get install curl vim git -y | |
sudo add-apt-repository ppa:jonathonf/python-3.6 -y | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
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
# BEFORE STARTING PUT libcudnn5_5.1.10-1+cuda8.0_amd64.deb AND libcudnn5-dev_5.1.10-1+cuda8.0_amd64.deb IN /tmp | |
# OTHERWISE THIS WON'T WORK | |
# This has been tested only on EC2 P2 xlarge instance with 16 GB storage and stock Ubuntu 16.04 | |
# It's a setup for a playground EC2 machine to perform workshops with Jupyter Notebook on GPU. | |
# It might contain some unnecessary crap | |
# The process takes like 15 minutes | |
pushd /tmp && | |
stat libcudnn5_5.1.10-1+cuda8.0_amd64.deb && | |
stat libcudnn5-dev_5.1.10-1+cuda8.0_amd64.deb && |
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 tensorflow as tf | |
# just to verify they're installed | |
import pandas | |
import matplotlib | |
import scipy | |
import numpy | |
# With CPU | |
with tf.Session() as sess: |
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
it ("should call containsWatch upon onMeasures() called", function() { | |
watchDataStore.containsWatch = sinon.stub().returns(when(null)); | |
return trendsD.onMeasures([{ | |
central: "centrala1", | |
element: "element", | |
property: "property", | |
value: 12 | |
}], false) | |
.then(function() { | |
expect(watchDataStore.containsWatch.callCount).to.equal(1); |
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
// revolutions per second | |
var angularSpeed = 0.2; | |
var lastTime = 0; | |
var SIZE = 50; | |
function de2ra(degree) { return degree*(Math.PI/180); } | |
// this function is executed on each animation frame | |
function animate(){ |