Skip to content

Instantly share code, notes, and snippets.

@ROki1988
ROki1988 / nginx.yaml
Created May 29, 2021 16:03
AppRunner
AWSTemplateFormatVersion: '2010-09-09'
Resources:
App:
Type: AWS::AppRunner::Service
Properties:
ServiceName: NGINX
SourceConfiguration:
ImageRepository:
ImageIdentifier: "public.ecr.aws/nginx/nginx:latest"
ImageConfiguration:
@ROki1988
ROki1988 / main.rs
Created October 24, 2020 13:49
sliding
use std::env::{args, args_os};
use std::io;
use std::io::Read;
/// $ seq 1 4 | sliding
/// > 1 2
/// > 2 3
/// > 3 4
fn main() -> Result<(), io::Error> {
let d = args().enumerate().find(|(_, x)| x == "-d").map_or_else(
@ROki1988
ROki1988 / Dockerfile
Created December 9, 2017 12:28
rust-crowbar-builer
FROM amazonlinux:latest
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
RUN yum install -y bzip2-devel gcc gcc-c++ git openssl-devel python27-devel python36-devel readline-devel sqlite-devel zip \
&& yum clean all
WORKDIR /usr/src
RUN curl -L https://www.openssl.org/source/openssl-1.1.0f.tar.gz | tar xz && \
cd openssl-1.1.0f && \
./config -fPIC --prefix=/usr/local --openssldir=/usr/local/ssl && \
make -j$(nproc) && \
@ROki1988
ROki1988 / ChatWork-API.swagger.json
Last active November 20, 2017 14:03 — forked from eiel/chatwork-api-swagger.yaml
ChatWork APIのSwagger
{
"swagger": "2.0",
"info": {
"title": "ChatWork API",
"version": "v2"
},
"host": "api.chatwork.com",
"basePath": "/v2",
"schemes": [
"https"
@ROki1988
ROki1988 / InnerProduct.pas
Last active August 3, 2017 00:58
InnerProduct
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Generics.Collections,
System.Math;
@ROki1988
ROki1988 / pet-snippet.toml
Created March 18, 2017 07:11
description
[[snippets]]
description = "generate model from swagger"
command = "java -Dmodels -jar /usr/local/Cellar/swagger-codegen/2.2.2/libexec/swagger-codegen-cli.jar generate -i https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/yaml/uber.yaml -o ./ -l scala"
@ROki1988
ROki1988 / get_active_window.rs
Last active July 18, 2016 08:17
rust_sample
extern crate winapi;
extern crate user32;
fn main() {
println!("{}", get_foreground_window_title())
}
fn get_foreground_window_title() -> String {
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;
@ROki1988
ROki1988 / main.rs
Created June 20, 2016 13:24
Rust sqrt
fn main() {
let sqrts = (2..100).map(|x| f64::from(x).sqrt());
for num in sqrts.into_iter() {
println!("{}", num);
}
}
@ROki1988
ROki1988 / COMUtils.pas
Last active June 25, 2016 06:51
COMUtils
unit COMUtils;
interface
uses
System.Classes, Winapi.ActiveX;
type
TCOMUseThread = class(TThread)
private