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
NSData *jpeg = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer] ; | |
CGImageSourceRef source ; | |
source = CGImageSourceCreateWithData((CFDataRef)jpeg, NULL); | |
//get all the metadata in the image | |
NSDictionary *metadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source,0,NULL); | |
//make the metadata dictionary mutable so we can add properties to it | |
NSMutableDictionary *metadataAsMutable = [[metadata mutableCopy]autorelease]; |
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
$ gphoto2 --get-config colortemperature --set-config colortemperature=4700 --debug --debug-logfile=xx.log | |
Label: Color Temperature | |
Type: TEXT | |
Current: 5000 | |
$ cat xx.log | |
0.000887 main(2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST: | |
0.001337 main(2): gphoto2 2.5.2 | |
0.001571 main(2): gphoto2 has been compiled with the following options: | |
0.001688 main(2): + gcc (C compiler used) | |
0.001758 main(2): + popt (mandatory, for handling command-line parameters) |
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
0.000726 main(2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST: | |
0.002714 main(2): gphoto2 2.5.2 | |
0.004418 main(2): gphoto2 has been compiled with the following options: | |
0.005955 main(2): + gcc (C compiler used) | |
0.007421 main(2): + popt (mandatory, for handling command-line parameters) | |
0.008819 main(2): + exif (for displaying EXIF information) | |
0.009623 main(2): + no cdk (for accessing configuration options) | |
0.009776 main(2): + no aa (for displaying live previews) | |
0.009944 main(2): + no jpeg (for displaying live previews in JPEG format) | |
0.010097 main(2): + no readline (for easy navigation in the shell) |
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
@form = Formotion::Form.new({ | |
sections: [ | |
{ | |
select_one: true, | |
rows: value["choices"].map do |choice| | |
{ | |
title: choice["description"], | |
key: choice["description"], | |
value: value["current"] == choice["description"], | |
type: :check |
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
{ | |
"from": 0, | |
"size": 30, | |
"query": { | |
"filtered": { | |
"filter": { | |
"and": [ | |
{ | |
"or": [ | |
{ |
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
package main | |
import ( | |
"bytes" | |
"exec" | |
"log" | |
"os" | |
) | |
// Pipeline strings together the given exec.Cmd commands in a similar fashion |
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 "mechanize" | |
require "nokogiri" | |
require "json" | |
emails = [] | |
a = Mechanize.new | |
a.get("https://postmarkapp.com/login") do |login_page| | |
servers_page = login_page.form_with(:id => 'new_user_session') do |form| | |
form.send "user_session[login]", ARGV[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
"products" : { | |
"product" : { | |
"properties" : { | |
"id" : { | |
"type" : "string", | |
"index" : "not_analyzed" | |
}, | |
"product_name" : { | |
"type" : "string", | |
"analyzer" : "keyword" |
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 "sinatra/base" | |
require "sinatra/namespace" | |
require "multi_json" | |
require "api/authentication" | |
require "api/error_handling" | |
require "api/pagination" | |
module Api | |
class Base < ::Sinatra::Base |
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
james@ubuntu:~$ time gphoto2 --capture-image-and-download --force-overwrite --filename='foo.jpg' --frames=3 --interval=5 | |
Time-lapse mode enabled (interval: 5s). | |
Capturing frame #1/3... | |
New file is in location /capt0000.jpg on the camera | |
Saving file as foo.jpg | |
Deleting file /capt0000.jpg on the camera | |
Deleting 'capt0000.jpg' from folder '/'... | |
Waiting for next capture slot 3 seconds... | |
Capturing frame #2/3... | |
New file is in location /capt0001.jpg on the camera |