View index.html
<html>
<head>
<style>
html, body { width: 100%; height: 100%; background: #000; }
body { margin: 0; overflow: hidden; }
canvas { width: 100%; height: 100%; }
</style>
</head>
<body>
<script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js'></script>
View get_timestamp.py
import datetime
print( str(datetime.datetime.now()).split('.')[0] )
View install.sh
sudo yum install mlocate && updatedb
---- install Oracle JDK 1.8
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm
sudo yum install -y jdk-8u141-linux-x64.rpm
---- install OpenJDK
sudo yum install -y java-1.8.0-openjdk-devel
sudo yum remove java-1.7.0-openjdk -y
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
View gist:a2176ac71215c080b243d6c87df5739c
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
View gh-pages-deploy.md

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

View axios.js
export const fetchTreeData = () => {
return dispatch => {
axios.get(config.endpoint + 'cats')
.then(res => dispatch(handleData(res.data)))
.catch(err => dispatch(requestFailed(err)))
}
}
View auth.js
exports.handler = (event, context, callback) => {
// Get the request and its headers
const request = event.Records[0].cf.request;
const headers = request.headers;
// Specify the username and password to be used
const user = 'top-secret-user';
const pw = 'top-secret-password';
View generate_data.py
# run this script first to generate dummy data
from random import random, randint
import json
# image we need to k-merge 10 files
for file_id in range(10):
file_keys = []
with open('data/' + str(file_id) + '.txt', 'w') as out:
# each of the 10 files will have 0:100 keys
for j in range(100):
View index
<html>
<head>
<style>
html, body { width: 100%; height: 100%; background: #000; }
body { margin: 0; overflow: hidden; }
canvas { width: 100%; height: 100%; }
</style>
</head>
<body>
<script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/88/three.min.js'></script>
View cluster_found_pairs.py
import json
import os
from itertools import combinations
from pymongo import MongoClient
from collections import deque
def group_lists(list_of_lists):
'''Combine all items in list_of_lists that share
an element recursively, until no two share an item'''
queue = deque( sorted(list_of_lists, key=lambda x:min(x)) )