Get Homebrew installed on your mac if you don't already have it.
Install highlight. Run brew install highlight
(this brings down Lua and Boost as well).
Get Homebrew installed on your mac if you don't already have it.
Install highlight. Run brew install highlight
(this brings down Lua and Boost as well).
IOJS_VERSION=v2.5.0 | |
IOJS_DIR=$HOME/.iojs | |
iojs_install() { | |
iojs_setup | |
iojs_download | |
iojs_assemble | |
iojs_teardown | |
} |
#!/bin/sh | |
# Clone redis from GitHub | |
# Run make && sudo amke install | |
# Copy and run this script from redis/utils folder as sudo | |
die () { | |
echo "ERROR: $1. Aborting!" | |
exit 1 | |
} |
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
#!/usr/bin/env python | |
import requests | |
import time | |
import json | |
token = '' | |
#Delete files older than this: | |
ts_to = int(time.time()) - 7 * 24 * 60 * 60 |
#!/usr/bin/env python | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
# Use Dockerized infrastructure | |
sudo: false | |
# Use node_js environnement | |
language: node_js | |
node_js: | |
- "6" | |
# Cache Gcloud SDK between commands | |
cache: |
import cv2 | |
def video_to_frames(video_filename): | |
"""Extract frames from video""" | |
cap = cv2.VideoCapture(video_filename) | |
video_length = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) - 1 | |
frames = [] | |
if cap.isOpened() and video_length > 0: | |
frame_ids = [0] | |
if video_length >= 4: |
import cv2 | |
def image_to_thumbs(img): | |
"""Create thumbs from image""" | |
height, width, channels = img.shape | |
thumbs = {"original": img} | |
sizes = [640, 320, 160] | |
for size in sizes: | |
if (width >= size): | |
r = (size + 0.0) / width |
import os | |
import cv2 | |
def run_example(): | |
"""Extract frames from the video and creates thumbnails for one of each""" | |
# Extract frames from video | |
print "Extract frames from video" | |
frames = video_to_frames('/path/to/video') | |
# Generate and save thumbs |