(function (d) {
var w = d.documentElement.offsetWidth,
t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
b;
while (t.nextNode()) {
b = t.currentNode.getBoundingClientRect();
if (b.right > w || b.left < 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
# Initializing DS418play with 4 x 6TB disks | |
# ssh to NAS as yourseld | |
# Check the RAID block device and tunable values | |
cat /proc/mdstat # was md2. Getting about 30M/s | |
# Get original values: | |
echo "speed_limit_max: `cat /proc/sys/dev/raid/speed_limit_max`" #=> 200000 |
This allows my Convolutional Neural Network to be trained tad little faster on 2013 MacBookPro15 (4core i7/16GB + NVidia GT750M/2GB) than a 2016 MacPro (6Core Xeon/32GB).
- OS - High Sierra 10.13
- Tensorflow - 1.4
- Xcode command line tools - 8.2 (Download from Xcode - Support - Apple Developer)
sudo xcode-select --switch /Library/Developer/CommandLineTools & clang -v
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 | |
# shell script to create a simple mongodb replica set (tested on osx) | |
set -e | |
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
default=$(tput sgr0) |
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
-- Reimplemented coroutine.wrap, returning "nil, err" if the coroutine cannot | |
-- be resumed. | |
local co_wrap = function(func) | |
local co = coroutine.create(func) | |
ngx.log(ngx.DEBUG, "co created with status ", coroutine.status(co)) | |
return function(...) | |
if coroutine.status(co) == "suspended" then | |
return select(2, coroutine.resume(co, ...)) | |
else | |
return nil, "can't resume a " .. coroutine.status(co) .. " coroutine" |
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
Getting started | |
=============== | |
# Make sure you have ggplot2 installed | |
install.packages("ggplot2") | |
library(ggplot2) | |
Basic examples | |
============== |
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
source 'https://rubygems.org' | |
gem 'rails', '3.2.1' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
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
#Steps to install RVM + Ruby 1.9.2 + Rails + nginx + Passenger on CentOS (tested on v5.5) | |
# Install git and curl, if not already installed | |
sudo yum install git | |
sudo yum install curl | |
# Create the rvm group and add any users who will be using rvm to the group | |
sudo su - | |
groupadd rvm |
NewerOlder