onelinerhub / onelinerhub Goto Github PK
View Code? Open in Web Editor NEWThousands of code solutions with clear explanation @ onelinerhub.com
Home Page: https://onelinerhub.com
License: MIT License
Thousands of code solutions with clear explanation @ onelinerhub.com
Home Page: https://onelinerhub.com
License: MIT License
const formData = new FormData();
const fileField = document.querySelector('input[type="file"]');
formData.append('username', 'abc123');
formData.append('avatar', fileField.files[0]);
try {
const response = await fetch('https://example.com/profile/avatar', {
method: 'PUT',
body: formData
});
const result = await response.json();
console.log('Успех:', JSON.stringify(result));
} catch (error) {
console.error('Ошибка:', error);
Filename: /favicon.ico
Status: 404 Not Found
Example: https://onelinerhub.com/apache
adduser test
Current (highlight.js) is very poor on some languages, example:
https://onelinerhub.com/mysql/concatenate_rows
Currently it's too hard to:
[program:test]
command=export DISPLAY=:0 && python test.py
user=root
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/test.log
loglevel=info
Example usage:
Add Python code pieces you use frequently here:
https://github.com/nonunicorn/onelinerhub/tree/main/python
How to do it:
https://github.com/nonunicorn/onelinerhub/blob/main/README.md
Add Postgres code pieces you use frequently here:
https://github.com/nonunicorn/onelinerhub/tree/main/postgres
How to do it:
https://github.com/nonunicorn/onelinerhub/blob/main/README.md
return to previous page example code
Have ability to specify same substrings, but mind the order (1st, 2nd, ...):
https://onelinerhub.com/c/swap_two_variables_values
In chart.js code pieces it's more convenient to copy just a part of configuration options by default, instead of whole code example. Think of creating new markup way to highlight default copying area in such cases.
window.onbeforeunload = function(e) {
var dialogText = 'Dialog text here';
e.returnValue = dialogText;
return dialogText;
};
Add Go code pieces you use frequently here:
https://github.com/nonunicorn/onelinerhub/tree/main/golang
How to do it:
https://github.com/nonunicorn/onelinerhub/blob/main/README.md
find /var/track -type f -not -newermt "-2 seconds"
[att^=val]
Add Lua code pieces you use frequently here:
https://github.com/nonunicorn/onelinerhub/tree/main/lua
How to do it:
https://github.com/nonunicorn/onelinerhub/blob/main/README.md
Now we have mixes: https://onelinerhub.com/?q=c/
Example code:
https://onelinerhub.com/imagemagick/convert_svg_to_png?at=inkscape
(Hovering doesn't highlight corresponding code part and path)
http {
log_format api '[$time_local] $remote_addr: '
'"$request" ($status) $body_bytes_sent bytes '
'$request_time s $upstream_response_time s';
# ...
server {
# ...
access_log /var/log/nginx/api.log api;
function csvstr(array $fields) : string
{
$f = fopen('php://memory', 'r+');
if (fputcsv($f, $fields) === false) {
return false;
}
rewind($f);
$csv_line = stream_get_contents($f);
return rtrim($csv_line);
}
Using Firefox (actually Waterfox Classic), looking at Python one-liners -- can only view first page. No way to scroll further, either with cursor or arrow keys.
E.g.: https://onelinerhub.com/htpasswd/add
middle explanation does not highlight, because it has a duplicate substring
Add Git code pieces you use frequently here:
https://github.com/nonunicorn/onelinerhub/tree/main/git
How to do it:
https://github.com/nonunicorn/onelinerhub/blob/main/README.md
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
What about some API for search or getting snippet ?
I just wanna make an app, but not fan of parsing LOL
html disable spell check
Possible think through as a constant solution:
https://onelinerhub.com/mysql/first_record_group
SET @id := null; UPDATE `apiqueue` SET status = 'processing' WHERE status = 'new' AND @id := id LIMIT 1
I suggest that this project be under a public organization so that we can have a better working environment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.