#LoopBack cheat sheet
##Recipies
Instantiate the sls-sample-app
slc example
cd sls-sample-app
slc install
# | |
# This Python script makes a summary of a football game by cutting | |
# the video around the 10 % loudest moments, which generally | |
# include the goals and other important events. | |
# For more details, see this blog post: | |
# http://zulko.github.io/blog/2014/07/04/automatic-soccer-highlights-compilations-with-python/ | |
# | |
# LICENCE: Creative Commons 0 - Public Domain | |
# I, the author of this script, wave any rights and place this work in the public domain. | |
# |
function C = getColourfulness( im ) | |
% | |
% C = getColourfulness( im ) | |
% | |
% MATLAB algorithm implementation of the | |
% "Measuring colourfulness in natural images" | |
% (Hasler and Susstrunk, 2003) | |
% | |
% Input: | |
% im - image in RGB |
#!/usr/bin/env python | |
''' | |
Send an multipart email with HTML and plain text alternatives. The message | |
should be constructed as a plain-text file of the following format: | |
From: Your Name <your@email.com> | |
To: Recipient One <recipient@to.com> | |
Subject: Your subject line | |
--- |
<?php | |
use Aws\Common\Aws; | |
use Aws\S3\Exception\S3Exception; | |
// make sure the SDK is installed | |
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html | |
/* | |
* jQuery File Upload Plugin PHP Class 7.1.0 | |
* https://github.com/blueimp/jQuery-File-Upload |
This is an example of how to use the Google Drive file picker and Google Drive API to retrieve files from Google Drive using pure JavaScript. At the time of writing (14th July 2013), Google have good examples for using these two APIs separately, but no documentation on using them together.
Note that this is just sample code, designed to be concise to demonstrate the API. In a production environment, you should include more error handling.
See a demo at http://stuff.dan.cx/js/filepicker/google/
/*! s3mirror.js */ | |
var knox = require("knox"); | |
var http = require("http"); | |
var opts = { | |
source: 'http://www.example.com/title.png', | |
knox: { | |
endpoint: 's3-ap-northeast-1.amazonaws.com', // tokyo region | |
key: '<api-key-here>', |
execfile("/your/path/to/videomaker.py") | |
videomaker( | |
ts_min=1352261778000, # "from" timestamp.. | |
ts_max=1352262378000, # .."to" timestamp | |
frames=20, # number of images in the video. eg 200 frames for a video at 20 frames per seconds = 10 seconds of video | |
output_prefix="/path/to/output/dir/frame_", # path where to write the png. images will be prefixed with "frame_" | |
output_format=".png" # you probably want to leave png here | |
) |
<!-- Bootstrap Markup --> | |
<div class="container"> | |
<ul class="thumbnails" id="hover-cap"> <!-- add id attr to thumbnail list --> | |
<li class="span3"> | |
<div class="thumbnail"> | |
<div class="caption"> | |
<h4>Caption Title</h4> | |
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</p> | |
<p><a href="#" class="btn btn-inverse" rel="tooltip" title="Preview"><i class="icon-eye-open"></i></a> <a href="#" rel="tooltip" title="Visit Website" class="btn btn-inverse"><i class="icon-share"></i></a></p> | |
</div> |
var fs = require('fs'); | |
var knox = require('knox'); | |
var mpu = require('knox-mpu'); | |
var request = require('request'); | |
var uri = "https://lh4.ggpht.com/N5f6FA5zPjrTH-UggaFLstYSO1za-01CbsO17ZwkghtF0k9TSzWcnCn4bybCDeIOP4cu=w124"; | |
// Open download stream from google | |
var downStream = request(uri); |