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 | |
trap 'kill $(jobs -p)' EXIT | |
for f in "$@"; do | |
tail -f "$f" | perl -pe "print '$f '" & | |
done | |
wait |
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
require 'sendgrid-ruby' | |
client = SendGrid::Client.new(api_key: 'XXXXXXXXXXXXXXXXXXXXX') | |
res = client.send(SendGrid::Mail.new(to: 'XXXXXXXX@XXXX.XXX', from: 'test@example.com', subject: 'Hello world!', text: 'Hi there!', html: '<b>Hi there!</b>')) | |
puts res.code | |
puts res.body |
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
require 'aws-sdk' | |
require 'aws_config' | |
require 'pry' | |
Aws.config.update( | |
:access_key_id => ENV['access_key_id'], | |
:secret_access_key => ENV['secret_access_key'], | |
:region => ENV['region'] | |
) |
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
require 'jawbone' | |
require 'awesome_print' | |
OAUTH_TOKEN = ENV["JAWBONE_TOKEN"] | |
client = Jawbone::Client.new OAUTH_TOKEN | |
p client.user | |
sleep 1 |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | |
<meta http-equiv="Content-Security-Policy" content="default-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'"> | |
<script src="components/loader.js"></script> | |
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.2.37.min.js"></script> | |
<link rel="stylesheet" href="components/loader.css"> | |
<link rel="stylesheet" href="css/style.css"> |
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
console.log('Loading function'); | |
const HEIGHT = 370; | |
const WIDTH = 320; | |
var fs = require('fs'); | |
var gm = require('gm').subClass({ imageMagick: true }); | |
var aws = require('aws-sdk'); | |
var s3 = new aws.S3({ apiVersion: '2006-03-01' }); |
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
<!-- node line_image.js input.jpg output.png --> | |
const HEIGHT = 370; | |
const WIDTH = 320; | |
if (process.argv.length < 4) { | |
console.log('missing argument.'); | |
return; | |
} | |
var gm = require('gm').subClass({ imageMagick: true }); |
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 | |
CMD="curl http://192.168.1.1/osc/commands/execute -s -H \"Accept: application/json\" -H \"Content-type: application/json;charset=utf-8\" -X POST -d" | |
SID=`${CMD} '{"name":"camera.startSession"}'| sed -E "s/^.*\"sessionId\":\"([^\"]*)\".*$/\1/"` | |
${CMD} "{\"name\": \"camera.takePicture\", \"parameters\": {\"sessionId\": \"${SID}\"}}" | |
FURI=`curl -X POST http://192.168.1.1/osc/state | sed -E "s/^.*\"_latestFileUri\":\"([^\"]*)\".*$/\1/"` | |
echo ${FURI} | sed "s/\//_/" > filename | |
cat filename | |
FILENAME=`cat filename` | |
${CMD} "{\"name\": \"camera.getImage\", \"parameters\": {\"fileUri\": \"${FURI}\"}}" > ${FILENAME} | |
${CMD} "{\"name\":\"camera.closeSession\",\"parameters\":{\"sessionId\":\"${SID}\"}}" |
NewerOlder