Skip to content

Instantly share code, notes, and snippets.

use hyper::service::service_fn_ok;
use hyper::{Body, Request, Response, Server, Client};
use std::io::{self, Write};
use hyper::rt::{self, Stream};
use futures::future::{self, Future};
const PHRASE: &str = "Hello, World!";
fn hello_world(_req: Request<Body>) -> Response<Body> {
rt::spawn(rt::lazy(|| {
@nirasan
nirasan / calc_repl.rs
Created May 3, 2019 08:10
Rust でつくる四則演算インタプリンタ
use core::borrow::Borrow;
use std::io::{self, Write};
use std::mem;
fn main() {
loop {
print!(">> ");
io::stdout().flush().unwrap();
let mut code = String::new();
@nirasan
nirasan / sample1.spec.ts
Created January 23, 2018 06:18
component-and-service-sample.spec.ts
import {Component} from '@angular/core';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
// コンポーネントの定義
@Component({
selector: 'parent-component',
template: '<p>parent component working.</p>'
})
class ParentComponent {
package repository
import (
"reflect"
"google.golang.org/appengine/datastore"
"context"
"errors"
)
// 保存するデータの型
package argumenter
import (
"testing"
)
func BenchmarkValidReflect(b *testing.B) {
for i := 0; i < b.N; i++ {
m := MyArg{}
e := ValidReflect(m)
package argumenter
import (
"fmt"
"reflect"
"strconv"
"strings"
)
/*