Skip to content

Instantly share code, notes, and snippets.

View dunnock's full-sized avatar
🎯
Focusing

Maxim Vorobjov dunnock

🎯
Focusing
  • I like programs that fulfill business needs
  • Kyiv, Ukraine
  • X @maxsparr0w
View GitHub Profile
@dunnock
dunnock / get_tasks.rs
Last active March 1, 2020 11:49
actix-node-benchmark: actix::get_tasks handler
#[get("/tasks")]
pub async fn get_tasks(
query: Query<GetTasksQuery>, db_pool: Data<Pool>
) -> Result<HttpResponse, BenchError> {
let tasks = db::get_tasks(db_pool.into_inner(), query.into_inner()).await?;
Ok(HttpResponse::Ok().json(tasks))
}
@dunnock
dunnock / SnapshotUploader.js
Last active July 11, 2017 19:10
Grommet with react-dropzone
import React from 'react';
import Dropzone from 'react-dropzone';
class SnapshotUploader extends React.Component {
onDrop = (acceptedFiles, rejectedFiles) => {
acceptedFiles.forEach(file => console.log(file, 'accepted'));
rejectedFiles.forEach(file => console.log(file, 'rejected'));
}
render() {