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
# xxxx は ~/.aws/credentials に記述されている profile | |
export AWS_DEFAULT_PROFILE=xxxx | |
export AWS_ACCESS_KEY_ID=`aws configure get aws_access_key_id` | |
export AWS_SECRET_ACCESS_KEY=`aws configure get aws_secret_access_key` | |
export AWS_DEFAULT_REGION=`aws configure get region` |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
fn response(&self, buf: &String) -> Result<SearchResponse<Self::I>, GitHubClientError> { | |
let result = json::decode(&buf)?; | |
Ok(result) | |
} |
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
extension Dictionary where Key : ExpressibleByStringLiteral { | |
func extractValue<T>(key: String) throws -> T { | |
let keyStr = key as! Key | |
if let r = self[keyStr] as? T { | |
return r | |
} | |
throw JSONDecodeError.missingValue(key: key, actualValue: self[keyStr]) | |
} |
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
extension Dictionary where Key : ExpressibleByStringLiteral { | |
func extractValue<T>(key: String) throws -> T { | |
let keyStr = key as! Key | |
if let r = self[keyStr] as? T { | |
return r | |
} else { | |
throw JSONDecodeError.missingValue(key: key, actualValue: self[keyStr]) | |
} | |
} |
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
#![feature(libc)] | |
extern crate libc; | |
use libc::*; | |
use std::ffi::{CStr, CString}; | |
#[repr(C)] | |
pub struct SampleStruct { | |
i: i32, | |
b: bool, |
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 'ffi' | |
module FFISample | |
extend FFI::Library | |
ffi_lib 'target/release/libffi_sample.dylib' | |
class SampleStruct < FFI::Struct | |
layout :i, :int, | |
:b, :bool, |
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
#![feature(libc)] | |
extern crate libc; | |
use libc::*; | |
use std::ffi::{CStr, CString}; | |
#[repr(C)] | |
pub struct SampleStruct { | |
i: i32, | |
b: bool, |
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 'ffi' | |
module FFISample | |
extend FFI::Library | |
ffi_lib 'target/release/libffi_sample.dylib' | |
# ガベージコレクタに回収される際に、Rust 側で確保されたメモリ領域を | |
# 開放するため、ManagedStruct を継承する | |
class SampleStruct < FFI::ManagedStruct |
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 'ffi' | |
module FFISample | |
extend FFI::Library | |
ffi_lib 'target/release/libffi_sample.dylib' | |
attach_function :perform, [:string], :string | |
end | |
NewerOlder