Skip to content

Instantly share code, notes, and snippets.

View nginx.yaml
AWSTemplateFormatVersion: '2010-09-09'
Resources:
App:
Type: AWS::AppRunner::Service
Properties:
ServiceName: NGINX
SourceConfiguration:
ImageRepository:
ImageIdentifier: "public.ecr.aws/nginx/nginx:latest"
ImageConfiguration:
View main.rs
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 Dec 9, 2017
rust-crowbar-builer
View Dockerfile
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) && \
View ChatWork-API.swagger.json
{
"swagger": "2.0",
"info": {
"title": "ChatWork API",
"version": "v2"
},
"host": "api.chatwork.com",
"basePath": "/v2",
"schemes": [
"https"
View InnerProduct.pas
program Project1;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Generics.Collections,
System.Math;
View pet-snippet.toml
[[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"
View get_active_window.rs
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;
View main.rs
fn main() {
let sqrts = (2..100).map(|x| f64::from(x).sqrt());
for num in sqrts.into_iter() {
println!("{}", num);
}
}
View COMUtils.pas
unit COMUtils;
interface
uses
System.Classes, Winapi.ActiveX;
type
TCOMUseThread = class(TThread)
private