warp
project: on github- also on docs.rs
todos.rs
example https://github.com/seanmonstar/warp/blob/master/examples/todos.rs
After starting the example (cargo run --example todos
) following are some handy curl commands
#!/bin/bash | |
find * -name '*.java' | xargs sed -i 's:^\(.*[^[:space:]]\)[[:space:]]*$:\1:;' |
use std::path::Path; | |
use std::process::Stdio; | |
use tokio::io::BufReader; | |
use tokio::io::AsyncBufReadExt; | |
use tokio::process::Command; | |
use tokio::sync::mpsc; | |
/// Execute a process, gather its mixed outputs into stdout | |
/// |
warp
project: on githubtodos.rs
example https://github.com/seanmonstar/warp/blob/master/examples/todos.rsAfter starting the example (cargo run --example todos
) following are some handy curl commands
#!/bin/bash | |
# Indicated files will be renamed by prefixing with their modification date. | |
# Useful for photos from old devices that did not store metadata. | |
# This only prints the `mv` commands (preview); pipe it to `sh` to apply the changes | |
function filetime() { | |
local f=$1 | |
local t=$(stat -c %y "$f") | |
t=${t%% *} |
I hereby claim:
To claim this, I am signing this object:
I need to have very simple, lightweight service that always redirects to another URL. No request parsing is needed so there should be no security risk.
class DateToIso { | |
/** | |
* This uses java formatter for the conversion | |
*/ | |
public String toString(Date date) { | |
return String.format("%tFT%<tT.%<tL", date); | |
} | |
} |
git config --global user.name 'Petr Kozelka'
git config --global user.email '[email protected]'
git config --global color.ui auto
git config --global log.date iso8601
git config --global alias.st 'status --porcelain'
git config --global core.excludesfile ~/src/pkozelka-admin/gitexcludes
///... somewhere in the servlet, called from doPost: | |
private void processUploadRequest(HttpServletRequest request, PrintWriter pw) throws FileUploadException, IOException { | |
final FileItemFactory factory = new DiskFileItemFactory(); | |
final ServletFileUpload upload = new ServletFileUpload(factory); | |
@SuppressWarnings("unchecked") | |
final List<FileItem> items = upload.parseRequest(request); | |
log("LIST: " + items); | |
for (FileItem item : items) { | |
final String fieldName = item.getFieldName(); | |
if (item.isFormField()) { |