Skip to content

Instantly share code, notes, and snippets.

View chaser92's full-sized avatar

Mariusz Kierski chaser92

View GitHub Profile
# -*- 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
@chaser92
chaser92 / ojejq-noperf.sh
Last active October 19, 2020 21:51
ojejq runner
#!/bin/bash
#MEM_LIMIT=""
if [ $# -lt 1 ]; then
echo "Usage: $0 <program_to_test> [args...]"
fi
SELF="$(readlink -f "$0")"
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;
@chaser92
chaser92 / vscode_config
Created July 27, 2019 16:05
VSCode Config
x
# 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 -
@chaser92
chaser92 / install_tensorflow_p2.sh
Last active May 23, 2018 01:10
Install TensorFlow and Anaconda on an Amazon EC2 P2
# 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 &&
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:
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);
// 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(){