Giter VIP home page Giter VIP logo

onelinerhub's Issues

Form data fetch post example

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);

[supervisor] / export display

[program:test]
command=export DISPLAY=:0 && python test.py
user=root
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/test.log
loglevel=info

Suggested copy area

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.

JS / before unload confirmation

window.onbeforeunload = function(e) {
  var dialogText = 'Dialog text here';
  e.returnValue = dialogText;
  return dialogText;
};

Code [NGINX] / request time log

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;

Code [PHP] array to csv

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);
}

Can't scroll past first page

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.

Search API

What about some API for search or getting snippet ?
I just wanna make an app, but not fan of parsing LOL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.