text:
I copied my password to the clipboard! Can you delete it?
Following the best security practices, I keep a plain text file with my passwords on my hard drive. In fact, I just copied and pasted one of them to access my PPCG account.
In a lucid moment, I decide that the password should better not remain in the clipboard after its use. Since this happens to me often, I could use a program to remove the clipboard contents.
Challenge
Write a program or function that deletes or overwrites any text contained in the clipboard, using a programming language of your choice.
Additional details:

If your system has several clipboards, you can write the program for any one of them. The only requirement is that it must be possible for the user to copy and paste text using that clipboard.

If your clipboard keeps a history of recent copied entries, assume the most recent entry.

If your answer is specific to an operating system or clipboard, indicate it in the title of your post, together with the used language.

The clipboard is guaranteed to contain text when your program is run. You can either delete the contents from the clipboard, or overwrite it with something else (not necessarily text). The only requirement is that after running the program, pasting from the clipboard will not produce the original text.

If you choose to overwrite with some fixed or randomly chosen text, you can assume that the previous clipboard contents are different from that text, so the password is effectively removed. In other words, disregard the possibility that the filler text coincides with the password.

The program should not have any side-effects like restarting the system, closing programs, shutting down the computer, or freezing it. After your program is run, the user should be able to keep using the computer as normal, only with the password removed from the clipboard. Also, standard loopholes are forbidden.

Shortest code in bytes wins.

What if the clipboard has an undetermined number of entries?

@LarsW Can you please ellaborate or give an example?

Well, on my computer I can access the last ~10 I copied/selected, but I can imagine that number being different on different systems. I don't know if this matters at all, so that's why I asked.

@LarsW Oh, I see. You can assume the most recent entry. Edited into the text

On a more serious note: Use something like keepass to do that for you.

"Disregard the possibility that the filler text coincides with the password." Solution:  , 0 bytes. Overwrites the password with itself.

@Challenger5 but that's only If you choose to overwrite with some fixed or randomly chosen text

The very worst part about this question is that I can completely relate to the intro story despite knowing that it's satirical.  ...so, keepass, huh?  Should look into that...

@Challenger5 That wouldn't be a full Java program or function ;)

Or you could...you know...copy something else?! Erase the last thing copied??!! Ha. Ha. Ha.

Excel, 1 keystroke
Ctrl-C
Works because Excel, uniquely, always has a selection. Probably works in other spreadsheet applications too. As opposed to the other joking entries, Excel answers are actually somewhat frequent on PPCG.

Isn't this 2 keystrokes?  "A keystroke is a single press of a key on a keyboard. Each key press is a keystroke." http://www.computerhope.com/jargon/k/keystroke.htm

@Martijn Possibly. I just copied from here.

I'm not sure it's really valid to score by keystrokes. Also, since you say As opposed to the other joking entries, I interpret that as you admitting this is not an actually valid answer. So I won't accept it even if it's the shortest one. If you can point me to some relevant meta-post establishing the validity of keystrokes as scoring method, I will happily accept this submission

@LuisMendo Your in-between-lines analysis  is correct, but now that I actually took the time ro research on Meta: https://codegolf.meta.stackexchange.com/a/4817/43319 would seem to indicate that it is acceptable, as opposed to "Windows" which isn't an editor.

@Adám My understanding it that that meta-post refers to a hypothetical "editor golf" challenge category, not to using the number of keystrokes as a scoring method for "code golf" challenges. I've pinged Doorknob and Dennis to know their opinion

I'm still not totally convinced that keystrokes are a valid scoring method and are comparable to bytes. But I haven't had any conclusive feedback to settle this, so I'm assuming it is valid and therefore accepting this answer

PowerShell, 3 bytes
scb

That's a default alias for Set-Clipboard. When called with nothing piped in and no arguments supplied, it blows away the current clipboard contents.

The shortest answer which actually clears the clipboard instead of setting it to a newline or something not-quite-blank.

This is very nice.

Vim, 3 bytes
"*Y

Sets the clipboard content to a newline.
By default, vim opens an empty buffer on start up. Now the program Yanks (copy) the entire line (including a newline) and store it in your clipboard by yanking it the text into register "*. The * can be changed to a + for the other clipboard.

Aaargh, I was just going to post this answer! +1, right tool for the job. :)

If there are more installations of vim than of powershell, this should be the accepted answer on the basis of "Universality" ;)

@JPCF and there are many more 'actual' applications written in C# than there are coffeescript etc. It doesn't make one better than the other when it comes to code-golf

I doubt there are more installations of vim than PowerShell, since it's installed by default in Windows 8 and up.

Javascript (Chrome DevTools Console), 6 bytes
copy``

Note that this is a feature of the console (which also works in the FF console) and is not part of the language standard.

Huh, I didn't know JS had this function. Works in Firefox too. (The contents of the clipboard become [\n    ""\n])

Can confirm this as well on Chrome. The clipboard changes to: [\n   ""\n ]

@ETHproductions Actually, this function doesn't really exist in JS. This is a console built-in. (Which doesn't invalidate the answer. But maybe it should be explained more explicitly.)

Well doesn't it exist through Document.execCommand("copy") or is that an internal-to-browser clipboard? I use that in some tamper monkey scripts, but too lazy to check it

Okay... this is now my new most upvoted answer

This copies [   "" ] to my clipboard

AppleScript, 20 bytes
set the clipboard to

Sets the clipboard to... nothing.

I saved a lot of bytes by removing the code to send me the contents of the clipboard ;)

Batch (Windows 7 and higher version), 7 bytes
fc|clip

Note: it will response error message like "FC:..." but it works.
"clip" is a command to copy the output of another program to clipboard (available since windows 7)
"fc" is a command to compare two or more files. in this case we not input any file. it will error, then "clip" will set clipboard to an empty string.
provided that you have a file "a" in your current directory (it can be empty), you can do one better:
clip<a

Edit: See @Matthew Steeples comment for the shorter version (but in powershell not a batch)

You could use sc instead of fc to avoid the error message. Then, the sc help text would be set on the clipboard. Also, +1 for telling me about clip.

My one used cd. :-)

I guessing clip won't pick up the output of a non-command? So you couldn't just run x|clip?

@djsmiley2k Yes, it will pick up only the output from a valid command.

The reason why sc and cd output is passed to the clipboard but fc won't is because sc and cd write its output to stdout but fc write its output to stderr (clip pick up an input from stdout but fc does not write anything to stdout)

You can knock another character off this. h is an alias (by default) for get-history, so you can do h|clip

Try to post 1 language per answer, so you should probably delete either the batch or powershell code.

@Riker just edited, thank for a suggestion

@Divcy feel free to post it as a separate answer!

@CPoll for later reference: Please don't make edits that add new code. Feel free to comment, but don't make edits.

@Divcy I saw that you approved the edit, please don't do that in the future (even though it's your post).  If you look, DJ rejected it also.

Bash on macOS, 8 bytes
:|pbcopy

: could be replaced with almost any other single character.

:|pbcopy works in bash as well as zsh.

Anyone else think :|p looks like a tongue-sticking-out emoticon with a mustache?

C (on Windows), 65 62 42 41 bytes
main(){EmptyClipboard(OpenClipboard(0));}

Note that the Visual C++ command-line needs /link user32.lib but the IDE or other compilers may automatically include this. Also this won't work in Win16 because the calling convention is incorrect.
Edit: Saved 3 bytes thanks to @Orion. Saved 20 bytes thanks to @KrzysztofSzewczyk. Saved a further byte thanks to @ceilingcat.

Since it's C, can't you use 0 instead of NULL?

Can you stick the OpenClipboard(0) inside the parens after EmptyClipboard?

AHK, 10 bytes (Windows)
clipboard=

Clears text content of the clipboard. If clipboardAll is used it clears everything.
From the docs -

Clipboard is a built-in variable that reflects the current contents of the Windows clipboard if those contents can be expressed as text. By contrast, ClipboardAll contains everything on the clipboard, such as pictures and formatting.

Java 8, 127 125 bytes
Golfed:
()->java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new java.awt.datatransfer.StringSelection(""),null)

Ungolfed:
public class ICopiedMyPasswordToTheClipboardCanYouDeleteIt {

  public static void main(String[] args) {
    f(() -> java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
      new java.awt.datatransfer.StringSelection(""), null));
  }

  private static void f(Runnable x) {
    x.run();
  }
}

Could you use an empty string instead of null? Saves 2 bytes

@Poke yes, that works. I was focusing on "deleting" the contents of the clipboard, as in truly clearing them out. Turns out overwriting is fine too.

Excel VBA, 9 8 bytes
[A1].Cut

Overwrites the clipboard with contents of A1 cell in active worksheet (empty by default but may be any string/expression of your choice - just make sure it's not your password!).
Utilises the Immediate Window.
One byte saved thanks to Slai

Nice! You can save a byte with [a1].Cut

SmileBASIC 3, 10 bytes
Finally, a challenge practically made for SmileBASIC 3!
CLIPBOARD"

CLIPBOARD is a builtin that sets the environment's text clipboard to the given string. Here we give it an empty string (closing " isn't needed!)

Thanks for the explanation, since that looks like two '!

Google Chrome Language, 2 keystrokes
Ctrl-S Ctrl-C
Based on this Notepad++ answer.
Google Chrome supports Javascript (which in turn supports RegExp), so I hereby claim it to be a superset of Javascript and a language of its own.
How it works:
Ctrl+S will invoke the "Save Page" dialog with the "New Tab" text pre-selected, Ctrl+C will copy it into the clipboard, displacing the previous content.
Sidenote:

You can access the Javascript functionality in Chrome, via javascript: URLs and the Developer Tools console (invoked with Ctrl+Shift+J)

Gah, I wanted to use Google Chrome, but I didn't realize that I could argue it as a superset of JS... well played.

Then I guess pressing the Print Screen button (1 keystroke) is a solution in Windows Language, which is a superset of Google Chrome Lang.

@MemetOlsen Yep, exactly, feel free to post it. We already have "Notepad++ Language" and "Google Chrome Language", so  "Windows Language" seem like the next logical step to take ! :)

@MemetOlsen it isn't quite a superset of Google Chrome Lang, since Chrome is an external "library" you have to download. It is a superset of IE lang, which is a superset of JS.

Thanks guys, I added my suggestion as my first answer on this SE site.

Python 56 48  40 bytes (Only works on Linux).
8 bytes saved thanks to @wheatwizard.
import os as o
o.system("echo|xclip")

Welcome to the site! I notice a few golfs you can do.  instead of importing system from os you can import os as o and call o.system instead.  You also don't need the spaces around your pipe in the bash command.

Sidenote, to make this work on OSX you can use pbcopy instead of xclip

print("") is also the same as print()

@WheatWizard Thanks, edited.

You can add 4 spaces to the beginning of each line to make it code formatting.  I also think you don't need the space after the echo (works on my system without it).

It's 6 bytes shorter without the as o part... (import os \n os.system("echo |xclip")

You can also replace echo  with : for ":|xclip"

Or just one line at 37 bytes: __import__('os').system("echo|xclip")

FYI, this only works for the middle-click paste, not Ctrl-V. (I don't think that's disallowed though)

@Dopapp Still not as short as Riker's suggestion.

There's also an alternative to xclip called xsel on Linux systems, which would save you another byte - and as already mentioned, remove the "as o" import part again, it just makes things longer: import os;os.system(":|xsel") (29 bytes).

@Riker, Of course, you could also use :|xclip -- foregoing Python altogether

@jpaugh that's already been done multiple times though...

Don't edit other people's code. If you have any suggestions leave them in the comments.

Mathematica, 17 bytes
CopyToClipboard@0

Sets clipboard to the number 0.

bash + xsel 8 7bytes
xsel -c

Explanation
-b: Works on clipboard selection
-c: clears the selection

+1, but this is not coreutils

@pacholik Yea you need to install the package, since I operated it on the terminal, I mentioned it as coreutils.

On Debian, xsel is in the xsel package, not part of coreutils.

Since we're allowed to use any clipboard we want to, I think you can drop the b.

@Digital Trauma Fair enough

R (Windows) 18
writeClipboard("")

Do you know of a Linux equivalent?

I think something like readLines(file("clipboard", "r")) might work. Try looking in the R help docs under "Functions to Manipulate Connections".

Bash, 11 10 8 7 bytes
2 bytes saved thanks to @seshoumara for using ls instead of echo
Thanks to hexafraction, isaacg and Riker for suggesting several 7-byters
w|xclip

The clipboard is set to the result of w. This only works on X11 based systems. For example, on macOS, this clipboard can be accessed by using an X based application like XQuartz.

Old answer only for macOS (11 9 bytes):
ls|pbcopy

This sets the clipboard content to a newline.

How about ls|xclip?

@seshoumara Thanks! (and to think that I ls /usr/bin | grep "^.\{1,3\}$"'d to search for a shorter command :P)

Or w|xclip for one less. Dumps list of logged-in users to the clipboard.

Or :|xclip. Actually clears the clipboard.

Thanks guys for the help, I used w|xclip since it was the only one that worked on macOS

Why would : not work? It's a Bash built-in.

@Dennis For some reason, it doesn't change the clipboard content for me

Huh, works on my machine. And since submissions may expect empty input, so would a bare xclip without any pipes.

Matlab, 19 13 bytes
gcf;print -dm

Set clipboard contents to an empty figure.

It's 21 UTF-8 bytes

@LuisMendo This is longer (23): axes;print -dmeta;close but also works...

@EBH That close can arguably be removed. By "side effects" I was thinking of things disappearing, not appearing. Also, print(gcf,'-dm') works

@LuisMendo Well, I didn't know that -dm is like -dmeta, and thought the program should work 'silently', without popping any window :)

@EBH Feel free to edit your code with the suggestions if you want. That's usual in PPCG. I just realized this is your first answer on this site :-)

@LuisMendo indeed, it is my first. Now the suggestion is even shorter.

Applescript, 23 bytes
set the clipboard to ""

Ohhh Thanks @DigitalTrauma

You could remove the quotation marks entirely, but It had been done already

Notepad++, 3 Keystrokes
a Ctrl-A Ctrl-C
Inserts the letter a, selects it, copies it to the keyboard.
Notepad++ is a valid language, it supports regex and is therefore a superset of regex, and we consider regex to be a valid language.

consider regex to be a valid language References ? Apparently RegExp is not Turing complete by itself.

@zeppelin It doesn't have to be Turing Complete to be a valid language.

It doesn't have to be Turing Complete to be a valid language By that measure, we can claim almost anything to be a "language".
I.e. XML or HTML do have a syntax too (and even call themselves languages, unlike RegExp), nevertheless I don't think they are acceptable.
Can you provide an example of a pure-Regexp answer, which has been upvoted by the community ?
Moreover I believe Notepad++, does not really "support regexp" in sense that it can invoke it programmatically, and opening the UI "Search and Replace" box to type a RegExp there, is not a "program code" by any measure.

@zeppelin http://meta.codegolf.stackexchange.com/a/4817/60042 <-- relevant meta post. Keep in mind you can access search-and-replace in N++ with <c-H>, and use <tab> to navigate through the UI and interact with all the relevant fields. Also note that regex can determine primality of and add numbers. (Both in unary, which is the default numeric representation for regex)

the meta-post in question refers to the Vim and Emacs class editors, which are extremely programmable, not Notepad.
And yes, I've seen people use RegExp for primality testing on this site, but that's just a funny corner-case and not a real proof of RegExp being a language. So please provide a reference to any upvoted "pure-Regexp" answer, to prove your point.

But, even if you think RegExp is a valid language, that does not make Notepad++ a language too, just because you can you can access search-and-replace in N++ with <c-H>, and use <tab> to navigate through the UI and interact with all the relevant fields, as that's just an isolated piece of functionality, requiring the UI interaction to launch it.
This way I can claim my IDE desktop shortcut to be a "a desktop shortcut language", just because I can launch my IDE by clicking on it.

just to illustrate my point, if I were to post an answer: Windows 7, 10 keystrokes: Win+R, type "echo.|clip", <CR> would you upvote it ? (and yes, Windows does support regexp and has a built-in shell and lot's of other things, but does it make it a "Windows-7-language" ?).

@zeppelin I would not, because that yields "Windows cannot find 'echo.|clip'". But in the general case, I wouldn't upvote it, because you're just executing shell commands so it would be a lot shorter if you said your language was batch. But it would be valid.

ok I think I can see your logic, and I've just beaten you by 1 keystroke with the [Google Chrome Language !] (http://codegolf.stackexchange.com/a/111731/61904)

I do this everyday in my real life...

Python 33 bytes (Only works on Windows).
4 bytes saved from @hubacub version.
3 bytes switching to windows, using @Divcy solution
import os
os.system("fc|clip")

Just registered in stackexchange, so I don't have the reputation to just comment on @hubacub submition. There is no need to expend 5 bytes with " as o" in the import to save 1 byte to reduce "os.system" to "o.system".

Welcome to the site!

Python + tkinter, 43 bytes
Python 3:
from tkinter import*;Tk().clipboard_clear()

Python 2:
from Tkinter import*;Tk().clipboard_clear()

is tkinter included in the python distro?

@Cruncher It is in my Python 3.

@Cruncher Yes, it's part of the stdlib, even though I believe debian packages it in a separate package (python-tk) from the "core python".

Take a look at Dopapp's comment for an even shorter way.

@jpaugh If you are referring to changing the import style to __import__("tkinter")...., this is 1 byte longer in this case.

Ok. Missed that, sorry!

you could save 2 bytes by removing () and having an unnamed function

C#, 30 bytes
Thanks to Nat, JMD and BgrWorker for their suggestions!
System.Windows.Clipboard.Clear

C# without WPF, 36 bytes
System.Windows.Forms.Clipboard.Clear

Built-in function which empties the clipboard.
Full program with test case:
using System;
using System.Windows.Forms;

class ClearClipboard
{
    static void Main()
    {
        Action f =
        ()=>System.Windows.Forms.Clipboard.Clear();

        // test case:
        Clipboard.SetText("SomePassword!");
        Console.WriteLine("In clipboard initially: " + Clipboard.GetText());
        f();
        Console.WriteLine("In clipboard now: " + Clipboard.GetText());
    }
}

System.Windows.Clipboard

Also, Clipboard.Clear() is already a function, so the lambda can be dropped.

I won't bother adding an answer for LINQPad since this answer would just run in it.
System.Windows.Clipboard.Clear();
But, lprun might be a more lightweight way to run this answer than VS or even VS Code.

@Nat When omitting .Forms, it didn't compile on Linux and I don't have a Windows machine at the moment.

@adrianmp that class is only contained in PresentationCore.dll, a reference added by default on WPF type projects. I have no idea if that dll is included in Mono/.NET Core

@BgrWorker That explains things. It's not available in my Linux install.

Haskell, 34 bytes
import System.Hclip
setClipboard""

Just a boring library function. There's also clearClipboard for the same byte count.

J (Windows), 12 bytes
wd'clipcopy'

wd is J's standard library for Windows. wd 'clipcopy password' would put the text password into the clipboard. Specifying nothing wipes the clipboard.
If you want a program to put your plaintext password into your clipboard, you could use the following:
pass =. 'abc123'
wd 'clipcopy ' , pass

This isn't a function or fill program, but rather a snippet. You'd need to make it a verb in order for it to be valid. you could do something like 'clipcopy 'wd@,]

Which "this" are you referring to? Both chunks of code are executable .ijs files.

I might have simply misunderstood. Sorry 'bout that haha. Anyhow, you can remove the space in between wd and 'clipcopy'.

Thanks! Shaved off a byte. I'm just so used to spaces to help me read J that I didn't think about it.

Tcl/Tk wish shell (REPL), 5 bytes
cli c

Wish shell (REPL) allows for the incomplete commands, as long as there is no ambiguity, the full command would be:
clipboard clear

HTML + JavaScript, 175 148 139 135 69 Bytes
Golfed:
<input value="c"onclick="this.select();document.execCommand('copy')">

Fiddle
Ungolfed
Got help from SitePoint
HTML:
<input style="display: none;" id="Empty" value="x">
<input id="clipclear" type="button" value="Clear The Clipboard">

JS:
function clearclip(){
empty=document.getElementById("Empty");
empty.style.display="block";
empty.select();
        document.execCommand('copy');
empty.style.display="none";
}
document.getElementById("clipclear").addEventListener("click", clearclip, false);

https://jsfiddle.net/kgvwjj3k/

Tested in FF and Chrome

Don't post it until you golf it. For now, you can delete your answer, edit it to golf it, and then un-delete your answer.

@NoOneIsHere, Okay, I went ahead and golfed it. Here's the new fiddle.

As my edit history shows, I'm not practiced at golfing. I originally forgot simple things like removing as much white space as possible.

Instead of commenting, please edit the fiddle into your answer. Also, great job on golfing. I gave you a +1. (FYI, the language is technically HTML + JavaScript.)

@NoOneIsHere I know, but it's JS that's doing the work.

Why can't clipboard be erased using js without user event such as clicking a button? Then one could copy something to clipboard and set a timer to wipe it.

Java 8 (JavaFX), 61 bytes
()->javafx.scene.input.Clipboard.getSystemClipboard().clear()
The JavaFX API for manipulating the clipboard is a little more terse than AWT's ;)

Cow, 9 bytes
OOOMMMOOO

Explanation:
OOO set current memory block to 0
MMM if the current memory block is 0, paste the clipboard and clear the clipboard.
OOO set it back to 0

This doesn't work: all it does is copy 0 to COW's internal register, which has nothing to do with the clipboard.

PHP + PHP GTK 2.0, 24 bytes
This assumes you already have the PHP GTK extension loaded.
<?GtkClipboard::clear();

Documentation reference: http://gtk.php.net/manual/en/html/gtk/gtk.gtkclipboard.method.clear.html

You don't need the opening <? tag since you can run the code without the <? tag in the command line with the -r switch. See more info here: http://meta.codegolf.stackexchange.com/questions/7098/is-the-php-opening-tag-mandatory-in-byte-count

@KodosJohnson I intentionally left the opening tag there.

@KodosJohnson He would still have to add the bytes in the flags.

@ckjbgames No I wouldn't. The flag is free. I didn't change the code because I intentionally left the opening tags.

@IsmaelMiguel I have seen people add the interpreter/compiler flags to the byte count.

@ckjbgames They must be adding other flags. Quoting the accepted answer: running programs via commands such as php -r "code here" is acceptable without penalty.

@IsmaelMiguel Which accepted answer are you quoting? Just out of curiosity.

@KodosJohnson http://meta.codegolf.stackexchange.com/a/7146/ <-- this answer.

@IsmaelMiguel Thanks, I was starting to be concerned that I should go back and add penalties to all my old answers.

Ruby, 11 bytes (Windows)
`echo|clip`

Runs the windows clip command to replace clipboard contents with "ECHO is on."

Julia - 13 bytes
clipboard("")

Hardly needing any explanation :-)

VB.NET, 29 bytes
Sub F
Clipboard.Clear
End Sub

Saved 2 bytes thanks to @hvd

Can you drop ()?

Why? https://dotnetfiddle.net/nZNS1E

Edit file outside of VS. You can also compile it from command line, but I think VS will compile it unchanged if it was saved from the other program.

Error: comment chain does not make sense. Please insert information about deleted comment >>

Parens are optional in vb.net when calling a function if there are no params.

For further golfing, you can drop (). :) They're equally optional in a sub or function definition.

Racket, 61 bytes
Clears the secondary X11 clipboard, or the usual clipboard on other systems.
#lang racket/gui
(send the-clipboard set-clipboard-string""0)

APL (Dyalog APL) on Windows, 27 26 bytes
⎕A⎕WC'Clipboard'('Text'⎕A)

⎕A using the name "ABC...Z",
⎕WC Window Create a
'Clipboard' object with the
('Text'⎕A) "ABC...Z"

Alternative of same length, but empties the clipboard and doesn't leave behind a global clipboard object:
(⎕NEW⊂'Clipboard').Text←''

⎕NEW⊂'Clipboard' create a NEW clipboard object
(…).Text←'' and set its Text property to the empty string

Clojure, 117 bytes
#(.setContents(.getSystemClipboard(java.awt.Toolkit/getDefaultToolkit))(java.awt.datatransfer.StringSelection."")nil)

Basically the Java answer. Gets the system clipboard, and sets it to an empty string.
AWT lets you do so many random things. It's so verbose though!
Unfortunately, trying to put an import in there adds about 30 bytes, so I need to fully qualify everything.
(defn clear-clipboard []
  (.setContents
      (.getSystemClipboard
        (java.awt.Toolkit/getDefaultToolkit))
      (java.awt.datatransfer.StringSelection. "")
      nil))

Cygwin (bash), 10 bytes
w>/dev/cl*

In Linux everything is a file. Except the clipboard. That is part of a program. How impure! Thankfully when Windows became enlightened with true ttys and bash, it was not hindered by the ancient blotch X. On Windows you can use the clipboard as file, the way it was meant to be used. (Ignore that this is worse for golfing).
Needs the procps-np package for w. In other mintty terminals (git bash), ls could be used.

Assuming /cygdrive/c/WINDOWS/system32 is on your $PATH, cd|clip also works.

Linux shell (text console), 10 (or 6) bytes
gpm -k;gpm

gpm(8) is the daemon providing mouse control for the Linux text terminal (not X11). gpm -k tells the daemon to shut down, no further pasting will be possible.
It could be shortened to just
gpm -k

which shutdowns the daemon but does not restart it - but it cold be argued that this goes against the "user should be able to keep using the computer as normal" requirement.

Yeah I would say it does. It is just supposed to clear it

Red, 19 bytes
write-clipboard ""

writes a null string to the system clipboard

Rust (Windows), 128 bytes
#[link(name="user32")]extern"C"{fn OpenClipboard(h:u8);fn EmptyClipboard();}fn main(){unsafe{OpenClipboard(0);EmptyClipboard()}}

Calls some Windows API functions improperly, doesn't even close the clipboard afterwards:
#[link(name = "user32")]
extern "C" {
    fn OpenClipboard(h: u8);
    fn EmptyClipboard();
}
fn main() {
    unsafe {
        OpenClipboard(0);
        EmptyClipboard();
    }
}

AutoIt, 11 bytes
ClipPut("")

Fills the clipboard with an empty string.

Ruby 25 bytes (MacOS)
IO.popen("pbcopy","w"){}

Launches the MacOS/OS X pbcopy as a subprocess and clears the clipboard.

This can be golfed down to 11 bytes: `:|pbcopy`

Tcl, 15 bytes.
Not the shortest but the most readable:
clipboard clear

note: must be executed with wish instead of tclsh

I think you should remove the note and change title to Tcl/Tk

Java, 56 Bytes
javafx.scene.input.Clipboard.getSystemClipboard()::clear

It can be used with an functional interface (for example java.lang.Runnable) just like
()->javafx.scene.input.Clipboard.getSystemClipboard().clear()

which was accepted as a function on page 1.
Full example:
public class Test
{
    public static void main(String... args)
    {
        Runnable test1 = () -> javafx.scene.input.Clipboard.getSystemClipboard().clear();
        Runnable test2 = javafx.scene.input.Clipboard.getSystemClipboard()::clear;

        // both are valid Runnable Objects on which you can call the run()-Method to clear the clipboard
        test1.run();
        test2.run();
    }
}

Julia 29 bytes
InteractiveUtils.clipboard(9)

Perl 5 + Win32::Clipboard, 41 bytes
$CLIP=Win32::Clipboard();
$CLIP->Empty();

Try it online!

Why do you have to put it into a variable?

@xigoi I'm not actually sure why I did that. I'm not very well versed with Perl, and I don't have a windows machine to try it on right now.

Windows 10, 2 keystrokes
Win + V Delete
Based on the excel answer, the Google Chrome answer, and the Notepad++ answer.
Opens Windows Clipboard (this must be enabled in settings) and deletes the current entry.

Java, 139 bytes
enum c{;static{java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new java.awt.datatransfer.StringSelection(""),null);}}

No one said that the program can't crash at the end.
Ungolfed version:
enum c {;
    static {
        java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new java.awt.datatransfer.StringSelection(""), null);
    }
}

In fact, exiting with an error is allowed by default

MFC, 54 51
OpenClipboard(0);EmptyClipboard();CloseClipboard();

Perhaps the first MFC submission ever!

If inside a method of a CWnd derived class I can use CWnd::OpenClipboard() which implementation is
_AFXWIN_INLINE BOOL CWnd::OpenClipboard()
    { ASSERT(::IsWindow(m_hWnd)); return ::OpenClipboard(m_hWnd); }

and I don't have to supply a parameter to OpenClipboard. Then it becomes:
MFC, 50
OpenClipboard();EmptyClipboard();CloseClipboard();

AutoIt, 11 bytes
ClipPut("")

Pretty simple.
10 bytes
ClipPut(0)

Could save 1 byte by setting clipboard to "0"

HTML 50 45 bytes
<x onclick=navigator.clipboard.writeText`x`>x

Click on the rendered letter x to copy x to the clipboard.

Factor, 38 bytes
""clipboard get set-clipboard-contents

AutoHotkey, 12 bytes
A_Clipboard=

AutoHotkey allows direct reading and writing to the clibpoard via the A_Clipboard global, and allows writing an empty string to a variable with just =.


text:
Mr Seckington weights his ternᵃʳʸ
Mr Seckington is a mobile grocer.  He drives his van door-to-door selling his produce all around the nearby villages.  Mr Seckington needs a method to weigh the produce he is selling so he knows how much to charge his customers.  Because space is at such a premium on his van, he uses an interesting sequence of weights on his scale that minimizes the amount weights he needs to measure any integer number of grams.

The weights (in grams) are all powers of 3, i.e 1, 3, 9, 27, 81...  He puts what he is weighing on the left side of the scale and he can put weights on either side of the scale to measure a desired weight with integer granularity.
For example if he wants to  weigh out 2 grams of peppercorns, he will put a 1g weight on the left side, a 3g weight on the right side, and then he can load the peppercorns onto the left side until the scale balances.
Similarly if he wants to weigh out 30g of chocolate chips, he'll put 3g + 27g weights on the right side and load chocolate chips onto the left side until the scale balances.
Given a positive integer weight as input, output two lists - one with the weights that must go on the left side of the scale and the other with the weights that must go on the right side.
It should be clear from the output which is the left-side list and which is the right-side list.  E.g. always ordering left, then right is fine.
The ordering within the lists doesn't matter.
You should be able to support inputs at least up to 88,573 (31+32+...+310).
Input -> Output
    1 -> {}, {1}
    2 -> {1}, {3}
    3 -> {}, {3}
    4 -> {}, {1 ,3}
    5 -> {1, 3}, {9}
    6 -> {3}, {9}
    7 -> {3}, {1, 9}
    8 -> {1}, {9}
    9 -> {}, {9}
   10 -> {}, {1, 9}
   13 -> {}, {1, 3, 9}
   14 -> {1, 3, 9}, {27}
   20 -> {1, 9}, {3, 27}
  100 -> {9}, {1, 27, 81}

Harold Seckington really did have a mobile grocery in the village that I grew up in.  However, I made up the bit about him using a ternary system of weights.

can we have extra zeros in the middle of the lists?

@Maltysen no, sorry

Closely related.

Can it be a single list with positive and negative values?

@LuisMendo no, two separate lists please.

MATL, 39 bytes
`x3:H-@Z^3@:q^*!tXsG=~}1MZ)Xzt0>&)_Xh&D

The output lists are in reversed order. Each list is actually a column array of numbers (square brackets, semicolon as separator). In MATL, as in MATLAB and Octave, an array with a single number is the  same as a number, so in that case the corresponding list doesn't have enclosing brackets.
Try it online! Or verifiy all test cases.
How it works
This keeps testing sets of weights of increasing size: the set {1}, then {1, 3}, then {1, 3, 9}, ... This is done with a do...while loop.
For any such set, containing k different weights, all possible distributions of those weights are tested.
A distribution of weights is defined by a vector of k numbers, where each number may be -1, 0,  1, meaning that the corresponding weight is on the left side, unused, or on the right side. For each distribution, the sum is compared with the target weight. This is done in a vectorized manner, using 2D arrays.
If for a given set of weights there is a distribution of those weights that matches the target, the solution has been found.

JavaScript (ES6), 113 … 76 75 bytes
Returns an array of two arrays [ [left_side], [right_side] ].
f=(n,x=!(r=[[],[]]),i=1)=>n+x?f(n/3|0,(x+=n%3)>1,i*3,x%3&&r[2-x].push(i)):r

Test cases

f=(n,x=!(r=[[],[]]),i=1)=>n+x?f(n/3|0,(x+=n%3)>1,i*3,x%3&&r[2-x].push(i)):r

console.log(JSON.stringify(f(  1))); // -> {}, {1}
console.log(JSON.stringify(f(  2))); // -> {1}, {3}
console.log(JSON.stringify(f(  3))); // -> {}, {3}
console.log(JSON.stringify(f(  4))); // -> {}, {1 ,3}
console.log(JSON.stringify(f(  5))); // -> {1, 3}, {9}
console.log(JSON.stringify(f(  6))); // -> {3}, {9}
console.log(JSON.stringify(f(  7))); // -> {3}, {1, 9}
console.log(JSON.stringify(f(  8))); // -> {1}, {9}
console.log(JSON.stringify(f(  9))); // -> {}, {9}
console.log(JSON.stringify(f( 10))); // -> {}, {1, 9}
console.log(JSON.stringify(f( 13))); // -> {}, {1, 3, 9}
console.log(JSON.stringify(f( 14))); // -> {1, 3, 9}, {27}
console.log(JSON.stringify(f( 20))); // -> {1, 9}, {3, 27}
console.log(JSON.stringify(f(100))); // -> {9}, {1, 27, 81}

Python2 - 109 102 bytes
Thought it might be fun to do it without a base conversion builtin.
a=[[],[],[],[]];r=input()+3**12;e=0;i=1
while r:c=r%3+e;a[c]+=[i];e=c>1;r/=3;i*=3
print a[2],a[1][:-1]

Batch, 178 bytes
@echo off
set l=
set r=
set/aw=%1,p=1,g=w%%3
goto %g%
:2
set l=%l% %p%
goto 0
:1
set r=%r% %p%
:0
set/ap*=3,w+=1,w/=3,g=w%%3
if %w% gtr 0 goto %g%
echo(%l%
echo(%r%

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Average Length of Google
I was messing around with Pyth's url request feature, and noticed that google always gave a response with a slightly different length for me, usually ~10500 characters.
So your task in this challenge is to print out the average length of the html response from http://google.com.
Specs

You will take an input n which is the number of requests to make.
For each request, you will make an HTTP get request.
You will count the response body (the html text), not the headers.
Output the arithmetic mean of the lengths of the responses.
You can only access the url http://google.com, not any other.
This is code-golf, so shortest code in bytes wins!

Sample output for input 10: 10560.1
(I used Python's urllib for that)
P.S: does anyone know why google does this?

Strange, http://google.com always returns 261 bytes for me... https://google.com/ncr might return more though.

@Neil Odd, http://google.com always returns 10422 bytes for me...

Can a ratio of integers (i.e., an exact fraction) be returned?

@LegionMammal978 no, sorry.

@Neil You get 261 bytes because you actually receive an URL redirection, code 302, which has in the body the new URL to follow. Some programs, like curl on linux, need a specific argument to follow that new URL automatically.

@seshoumara TBH the challenge does not specify to follow redirections, so I would expect Neil's answer to be the correct answer by default, since it handles the actual HTTP response that http://google.com sends. Of course this isn't the point of the challenge, so the challenge should IMO be edited to reflect that.

@Aaron I agree, my comment above was more of an explanation to why he felt it was strange getting 261 bytes. I should have not mentioned the second part, but I was writing my own answer at that time with redirection, so I didn't realized it wasn't actually necessary.

Which average?`

@theonlygusti the arithmtic mean

Bash + system utilities, 56 53 49 48 bytes
Update: saved 4 bytes thanks to Digital Trauma and 1 byte more thanks to Dennis
curl -L `yes google.com|sed $1q`|wc|dc -e1k?$1/p

In my original answer I was using yes in combination with xargs to emulate a for loop. But curl can accept as input a list of URLs, so only the output from yes is actually needed.
When curl accesses google.com, it receives a 302 redirection page that has the new URL in the body section, so the -L option is needed to follow it.
Run example: answer is printed to STDOUT, I redirect STDERR just for clarity
me@LCARS:/PPCG$ ./google_length.sh "8" 2> /dev/null
10583.2

Explanation: (of the initially submitted code)
yes google.com|     # repeatedly output a line containing the string "google.com"
sed $1q|            # print the first $1 lines only (shorter than head -$1)
xargs curl -sL|     # xargs reads the input lines and executes "curl -sL" with the
                    #current input line as an additional argument.
wc -m|              # count the number of characters
dc -e1k?$1/p        # dc script: set precision to 1, read input, push $1 and divide

Edit: I replaced wc -m with wc, because even if without arguments it prints 2 more statistics than the one I wanted, the same dc script following this output still works, because the count we want is, happily, placed on top of the stack during parsing.

@DigitalTrauma Very nice, no need for xargs. Thanks, I updated the answer.

You don't need -s. Stray output to STDERR is allowed by default.

@Dennis Thanks, answer updated.

MATL, 28 bytes
:"'http://google.com'Xin]vYm

Gif or it didn't happen:

How it works
:                      % Implicitly input n. Push [1 2 ... n]
"                      % For each
  'http://google.com'  %   Push this string
  Xi                   %   URL read. Gives a string
  n                    %   Number of elements
]                      % End
v                      % Concatenate stack contents into a vertical vector
Ym                     % Mean. Implicitly display

PowerShell, 48 bytes
1.."$args"|%{irm google.com}|measure Le* -a|% A*

Explanation

Create a range from 1 to the input integer.
For each value in the range Invoke-RestMethod (irm) the google homepage. The result is not JSON so it will return the body verbatim instead of deserializing it.
Send that to Measure-Object (measure), getting an average of the Length property of the input strings (the bodies).
Expand the resulting Average property.

did not know |% A* was possible, i've always avoided measure because I thought you couldn't wildcard the property name...

@ConnorLSW yeah this is something I discovered recently while preparing a presentation on code golf in PowerShell. Check out |? A* for some cool stuff as well. I need to look at my presentation files and add this stuff to the tips thread.

@ConnorLSW added some detailed info on these usages in the tips page.

Java 8, 197 184 182 181 bytes
Golfed:
n->{int s=0,i=0;while(i++<n)try{s+=new java.util.Scanner(new java.net.URL("http://google.com").openStream()).useDelimiter("\\A").next().length();}catch(Exception e){}return s*1f/n;}

Ungolfed:
public class AverageLengthOfGoogle {

  public static void main(String[] args) {
    float bytes = f(n -> {
      int s = 0, i = 0;
      while (i++ < n) {
        try {
          s += new java.util.Scanner(new java.net.URL("http://google.com").openStream())
              .useDelimiter("\\A").next().length();
        }
        catch (Exception e) {
        }
      }
      return s * 1f / n;
    } , 10);
    System.out.println(bytes);
  }

  private static float f(java.util.function.IntFunction<Float> f, int n) {
    return f.apply(n);
  }
}

This leaks resources, but that is a small price to pay in search of the fewest bytes.

Possible improvements:

double -> float
http://www.google.com -> http://google.com
maybe specifying encoding is not necessary, there should be some deprecated method
You should save some 20 bytes

@kukis thanks, that shaved off 13 bytes.

n->{int s=0,i=0;for(;i<n;++i)try{...}catch(Exception e){}return s*1.0/n;}. Not sure whether you can replace s*1.0/n in the return with s*1f/n, but it's worth a try

@RomanGräf yes, that works. Thanks!

for(;i<n;++i) can be changed to for(;i++<n;) for -1 byte.

You can save 2 bytes by changing
System.out.println(bytes); to
System.out.print(bytes);

@KBusc the main method as a whole is not included in the byte count for golfing purpose. Only the lambda counts, and it simply returns the value which is allowed in these competitions unless otherwise specified. So println() has no bearing on the score for the function I wrote. Besides, Java is inconsistent with flushing the buffer before the program terminates: sometimes it will, sometimes it will not.

PHP, 90 78 bytes

while($i++<$argv[1]){$s+=strlen(file_get_contents('http://google.com'));}echo $s/$argv[1];

while($i++<$argv[1])$s+=strlen(join(file('http://google.com')));echo$s/($i-1);

Used shorter functions/variables and removed unnecessary syntactic construct as mentioned by commenters

Wellcome to codegolf.se ! join(file()) instead of file_get_contents() saves you a few bytes.

In addition you can drop the curly braces and the space after the echo. Also you can use $i instead of $argv[1] as the divisor.

05AB1E, 15 bytes
Code:
F’Š¹.ŒŒ’.wgO}¹/

Explanation:
F           }     # Input times do..
 ’Š¹.ŒŒ’          #   Push the string "google.com"
        .w        #   Read all and wrap into a string
          g       #   Get the length
           O      #   Sum it up with the total
             ¹/   # Divide by input

Uses the CP-1252 encoding. When run in the offline interpreter I get the following:
> py -3 05AB1E.py -c test.abe
1
11039.0

> py -3 05AB1E.py -c test.abe
2
11070.0

> py -3 05AB1E.py -c test.abe
3
11046.666666666666

> py -3 05AB1E.py -c test.abe
4
11029.75

> py -3 05AB1E.py -c test.abe
5
11015.8

Either you have a built-in for google.com or something else is going on!

@Pureferret It's actually a dictionary compressed string. You can try it out here :).

Is using languages dedicated to golfing allowed? If so, then I can theoretically make up language that will do all of these things in one byte

@kukis Using dedicated golfing languages are allowed, if and only if the language version that is used doesn't postdate the challenge. If you make up a language that can do all these things in one byte, but the compiler was made after the challenge, it is a violation of both this and this.

Pyth, 25 bytes
.OmslM'"http://google.com

' is the open function in Pyth, and when given a string starting with http, it performs a GET resuest to that website. The return value is a list of bytes objects. Unfortunately, Pyth's s doesn't know how to concatenate these objects, so instead of ls, I use slM to get the total length. This is performed a number of times equal to the input by m, and the results are averaged by .O.

Mathematica, 58 bytes
N@Mean[StringLength@URLFetch@"http://google.com"~Table~#]&

Anonymous function. Takes a number as input, and returns a number as output.

Why do you need N@? You aren't printing it, so there's no reason to format it nicely.

@Pavel OP specified that exact fractions aren't allowed.

Python, 102 bytes
import urllib2
f=lambda n:sum([len(urllib2.urlopen(x).read()) for x in ['http://google.com']*n],0.0)/n

Or, if we can return integers rather than floats, the answer can be 98 bytes:
import urllib2
f=lambda n:sum([len(urllib2.urlopen(x).read()) for x in ['http://google.com']*n])/n

You can remove a couple spaces in there. )for x in[. Also, if you restrict yourself to Python 3, the division will automatically be float division, and you can remove 0.0.

You also don't need the [] in the 2nd case - sum takes a generator

CJam, 23 bytes
rd_"google.com"a*:gs,\/

Doesn't work on TIO for security reasons.
Test run
$ echo -n 'rd_"google.com"a*:gs,\/' > google-avg.cjam
$ wc -c google-avg.cjam
23 google-avg.cjam
$ java -jar cjam-0.6.5.jar google-avg.cjam <<< 10; echo
10663.2
$ java -jar cjam-0.6.5.jar google-avg.cjam <<< 10; echo
10650.0
$ java -jar cjam-0.6.5.jar google-avg.cjam <<< 10; echo
10651.0
$ java -jar cjam-0.6.5.jar google-avg.cjam <<< 10; echo
10651.4
$ java -jar cjam-0.6.5.jar google-avg.cjam <<< 10; echo
10673.5

How it works
 rd                      e# Read a double from STDIN. Let's call it D.
   _                     e# Push a copy of D.
    "google.com"a        e# Wrap the string in an array, pushing ["google.com"].
                 *       e# Repeat the array D times.
                  :g     e# Map `get` over the array, making D requests to the URL.
                    s    e# Combine all D responses into a single string.
                     ,   e# Compute the length.
                      \  e# Swap the length with the original D.
                       / e# Perform division.

Python 3, 95 bytes
Recursive solution
import requests as r
f=lambda n,t:f(n-1,t+len(r.get('http://google.com').text)) if n>0 else t/i

where n=i=int(input())
requests library

Requests seems to be an external library, so you'll want to add a link to that. Something like Python 3 + [Requests](http://docs.python-requests.org/en/master/user/install/#install), 95 bytes

urllib2 is a native (pre-installed) Python library https://docs.python.org/2/library/urllib2.html so anyone downloading Python can immediately run their code. I can't run your code on my Python 3 without that library.

@ValueInk no problem, my first contribution here, I didn't know

Perl, 66 bytes
perl -MLWP::Simple -pe'map$t+=length get"http://google.com",1..$_;$_=$t/$_'

51 bytes + 14 bytes for -MLWP::Simple<space> + 1 byte for -p.
Straightforward solution using LWP::Simple. The get function is exported by default and returns the response content on success.
Perl 5.14+, 94 93 bytes (core modules only)
perl -MHTTP::Tiny -pe'map$t+=length${+get{new HTTP::Tiny}"http://google.com"}{content},1..$_;$_=$t/$_'

79 bytes + 13 bytes for -MHTTP::Tiny<space> + 1 byte for -p.
Uses HTTP::Tiny, which has been in core since Perl 5.14.
How it works
This:
get{new HTTP::Tiny}"http://google.com"

is the indirect object syntax equivalent of this:
HTTP::Tiny->new->get("http://google.com")

and saves three bytes. The get method returns a hashref with the content stored under the content key.
To get the actual response content, we do:
${+get{new HTTP::Tiny}"http://google.com"}{content}

which is equivalent to:
(get{new HTTP::Tiny}"http://google.com")->{content}

but saves one byte when we add length:
length(foo)->{bar}  # wrong, equivalent to (length(foo))->{bar}
length+(foo)->{bar}
length${+foo}{bar}

Clojure, 102 bytes
(fn[n](/(reduce + 0.0(repeatedly n #(count(slurp(clojure.java.io/reader"http://www.google.com")))))n))

Ungolfed:
(fn [n]
  (/
   (reduce + 0.0
           (repeatedly n
                       #(count (slurp (clojure.java.io/reader "http://www.google.com")))))
   n))

#(count (slurp (clojure.java.io/reader "http://www.google.com"))) is a local function which counts the bytes from an http request to google, repeatedly calls the function n times and makes a list from the returned counts, reduce sums the results together, and finally that is divided by n to make an average. The reduce is started at 0.0 to force the result into a float- otherwise the division would result in a rational. Whole thing is wrapped in an anonymous function which takes the number of times to name the request.

I swear I didn't copy this answer! Mine ended up quite close to yours. The (clojure.java.io/reader) part is unnecessary btw. It's done automatically behind the scenes if you pass a string.

Clojure, 70 bytes
#(/(reduce(fn[a _](+ a(count(slurp"http://google.com"))))0(range %))%)

A fold over a n long range. Sums the length of each request, then divides it by number of requests. Due to the way Clojure handles division, this returns a fraction, not a decimal. If this is unacceptable, I can fix it at the cost of a couple bytes.
(defn avg-request-len [n]
  (/
    (reduce (fn [acc _]
              (+ acc (count (slurp "http://google.com"))))
            0
            (range n))
    n))

Ruby, 73 + 10 = 83 bytes
Uses the -rnet/http flag.
->n{s=0.0;n.times{s+=Net::HTTP.get(URI"http://www.google.com").size};s/n}

Rebol, 69 bytes
n: 0 loop i: do input[n: n + length? read http://www.google.com]n / i

CJam, 27 bytes
{"google.com"g,}ri*]_:+\,d/

CJam assumes HTTP if not specified.
Explanation
{"google.com"g,}             A block which fetches from http://google.com and gets its length
                ri*          Run this block a number of times equal to the input
                   ]         Collect all the results in an array
                    _        Duplicate the array
                     :+      Sum it
                       \     Swap back to the original array
                        ,    Get its length
                         d/  Cast to double and divide
                              (without casting, it would be integer division)

Common Lisp + quicklisp/dexador, 23 + 72 = 95 bytes
If quicklisp is installed on the system it will download and install dexador as neccesary.
Prelude:
(ql:quickload :dexador)

Code
(lambda(n)(/(loop :repeat n :sum(length(dex:get"http://google.com")))n))

Ungolfed:
(lambda (n)
  (/ (loop :repeat n
           :sum (length (dex:get "http://google.com")))
     n))

Explaination
(dex:get "http://google.com")
This performs the web request to google and returns five values:

The web request itself as a string or byte array (depending on content type)
The http status code
A hash map of the http response headers
A QURI object representing the final URI after resolving redirects
The socket used to communicate with the web server (if it wasn't closed by the server or one of the optional args to the function)

(length (dex:get ...))
If you don't explicity request otherwise, Common Lisp will discard all the return values other than the first, so the length function only sees the http response itself and returns the length of this string.
(loop :repeat n :sum (length ...))
This calculates the response length n times and adds them.
(/ (loop ...) n)
This divides the summed lengths by n to compute the average.
(lambda (n) ...)
This wraps the body of code in an anonymous function which takes n as an argument and returns the average response length for n web requests to http://google.com.

05AB1E, 14 bytes
’Š¹.ŒŒ’и.w€gÅA

’...’и.w€gÅA  # trimmed program
          ÅA  # mean of elements of...
         g    # lengths of...
        €     # each element of...
      .w      # content of responses from urls...
              # (implicit) "http://" concatenated with each element of...
     и        # list of...
              # implicit input...
’...’         # "google.com"...
     и        # s
              # implicit output

Vyxal, 9 bytes
ƛ`‹`¨UL;ṁ

Try it Online!
The joys of the short dictionary.
Explained
ƛ`‹`¨UL;ṁ
ƛ      ;      # over the range [1, input]:
 `‹`          #     push "https://www.google.com" and
    ¨U        #     do a GET request
      L       #     taking the length of the result
        ;ṁ   # take the average of that list

when the 05AB1E ties the vyxal beats 05AB1E

@makonede I don't think it do

It beats your answer now actually since you're sending a GET request to http://?<!.

@makonede wdym? Looks like I'm sending a get request to google to me

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Input number; Output line number
Code Golf
Totally real backstory: I'm a contractor working on a website www.Sky.Net and one of our tasks it to create some self-aware program or something, I don't know I wasn't really listening to the boss. Anyways in an effort to make our code more self-aware we need IT to be able to know what code is on each line-number.

Challenge
Create a program or function that takes an input n and returns the code of said program or function on line n.

Rules
➊ Your program or function must be at least 4 lines long. Each line must be unique.
➋ You may assume the input will always be a positive integer greater than or equal to 1 and less than or equal to the number of lines in your program/function.
➌ The first line in your program/function is line 1, not line 0.
➍ You can not access the file that your program is on. (If someone has to ask "Isn't this technically breaking rule #4"; it probably is)
➎ Lines can-not be empty (this includes a space if spaces don't do anything in your language)
➏ Lines can-not be //comments (/* of any <!--style)

This is a quine-like challenge
This is code-golf, so the submission with the fewest bytes wins!

Let us continue this discussion in chat.

I'd like to see this done in 99 :)

@JonathanAllan You might run into the issue where not every line is unique

"Lines cannot be comments, but I guess effective no-ops are OK" (but honestly, sometimes it's hard to say whether a line should count as a no-op or not; for example my Ruby answer has the last line be only a curly bracket to end the lambda)

The title might be better "Input number; Output line with that line number"? Or even "Output line by number".

@PaŭloEbermann That's more accurate but I'm a minimalist

@AlbertRenshaw the point is that the title sounds more like searching for the input number in some text and returning the line number where it is found.

Vim, 7 bytes
1
2
3
4

Try it online!
As far as I can tell, this complies with all of the rules. In vim by default, the empty program prints out all of the input. Since
<N><CR>

Is a noop, nothing changes the input text, and since each input matches the desired output, this same approach works with any number of lines.

Will work in other languages - first addition: Pyth

Wait, bytes? Vim is measured in keystrokes.

@JonathanAllan It looks like Pyth is configured wrong on TIO. If you look at the debug output, you can see that the code that is actually being run is the thing in the argument field, not the thing in the code field. This is what actually running that code looks like.

@isaacg Oh, OK posting in TIO room...

@Pavel only in editor golf challenges

This also works in Brachylog

Ruby, 71 70 66 bytes
Try it online!
->n{
k=["}", "k[-n]%%k.inspect", "k=%s", "->n{"]
k[-n]%k.inspect
}

"Cheating" Mode: 7+1 = 8 bytes
Requires the -p flag for +1 byte. Literally a copy of the V answer. Prints the number that is inputted; the entire program is effectively just no-ops.
1
2
3
4

What does -p do?

@Pavel It causes the program to read each line of STDIN into $_, runs the program contents, and then prints the contents of $_ to screen (repeating per line of STDIN). Since the program does nothing, it's practically just Unix cat, but that means that every input from 1-4 will output the contents of the line, because each line is literally its line number.

@Pavel for more information see https://robm.me.uk/ruby/2013/11/20/ruby-enp.html

I like your "cheating" answer. Perl also has -p, but 1\n2\n3\n4 is not a valid Perl program.

Haskell, 69 59 bytes
(lines(s++show
 s)
 !!)
s="\n(lines(s++show\n s)\n !!)\ns="

Based on the standard Haskell quine. The first expression (spread over the first three lines) is an unnamed function that picks the nth line from the quinified string s (s++show s). +2 bytes for making indexing 1-based (imho an unnecessary rule).
For a Try it online! version I have to name the function which adds 4 bytes.

Does this break rule 6? :)

Line indexing is not supposed to be 0-based, the rules explicitly require 1-indexing.

@AlbertRenshaw: fixed

@ValueInk: fixed

@nimi lol, "solutions" like this are why I was tempted to make this a popularity contest haha. Nevertheless, good work!

PowerShell, 184 172 bytes
$v=0,
'$v=0,',
"'`$v=0',",(($q='"{0}`$v=0{0},",(($q={0}{1}{0})-f([char]39),$q)')-f([char]39),$q),
(($z='(($z={0}{1}{0})-f([char]39),$z;$v[$args]')-f([char]39),$z);$v[$args]

Try it online!
Explanation
Starts by creating an array $v on the first line. On that same line, the first (0th) element is set to 0, and a comma , continues its definition.
The next line sets the next element (1) of the array to a string representing the content of the first line of the script, so that $v[1] returns the first line.
The 3rd line first sets the 3rd element of the array (index 2) to a string representing the 2nd line of the script, then on the same line sets the 4th element (index 3) using a quine snippet that uses the format operator (-f) to replace certain instances of single quotes ([char]39) and the format template string, into itself, to reproduce the entirety of the 3rd line.
Line 4 basically does the same thing, but also ends the creation of the array and then indexes into it using the supplied argument.

Python 2, 104 73 67 bytes
Thanks to Jonathan Allan for saving 6 bytes!
s=\
['print s[input()]or s', 's=\\', 0, 'exec s[', '0]']
exec s[
0]

Edit: Same byte count, but I like this solution better
Try it online!
Python version of Value Ink's Ruby answer.
Older answer (67 bytes):
1
s=\
['print s[-input()]or s', 0, 's=\\', 1]
print s[-input()]or s

Save 6 by getting rid of n: TIO

@ovs the challenge requirement requires 4 lines minimum of source code though :V

CJam, 19 18 17 bytes
1
{'_'~]ri(=}
_
~

Try it online!
Based on the standard CJam-quine. The {...}_~ runs the ... with the block itself on the stack (and in this case, also 1 below that). Then we do:
'_'~  e# Push the third and fourth line.
]     e# Wrap all four lines in a list.
ri    e# Read input and convert to integer.
(=    e# Use as index into the lines.

This is beautiful. Also like the logic's smiley face ending (= haha

PHP, 261 bytes
<?php function f($l){
$a="aWYoJGw9PTEpJG09Ijw/cGhwIGZ1bmN0aW9uIGYoXCRsKXsiO2lmKCRsPT0yKSRtPSJcJGE9XCIkYVwiOyI7aWYoJGw9PTMpJG09IlwkYj1cIiR";
$b="iXCI7IjtpZigkbD09NCkkbT0iZXZhbChiYXNlNjRfZGVjb2RlKFwkYS5cJGIpKTt9Pz4iO2VjaG8gJG07";
eval(base64_decode($a.$b));}?>

Try it online !!
The encoded string is:
if($l==1)$m="<?php function f(\$l){";
if($l==2)$m="\$a=\"$a\";
if($l==3)$m="\$b=\"$b\";
if($l==4)$m="eval(base64_decode(\$a.\$b));}?>";
echo $m;

Interesting! What are the encoded strings?

@Albert Renshaw  I have edited it to add decoded version of the string.

Perl, 52 bytes
$_=q{print+(split/
/,"\$_=q{$_};
eval")[<>-1]};
eval

This is a simple variation on the classic quine
$_=q{print"\$_=q{$_};eval"};eval

The "payload" is split on newlines and the correct line is selected by indexing into the resulting list.
Perl, 49 48 bytes (non-competing)
#!/usr/bin/perl -d:A
sub DB'DB{
print${"_<$0"}[<>]}
1

38 bytes for the code (excluding the shebang but including -d:A) plus 10 bytes for the filename, which must be Devel/A.pm. The Devel directory must be in @INC.
Technically, this violates Rule #4 because -d:A causes the file to be parsed twice, so it's a non-competing solution.
It uses a debugger hook to access the lines of the file, which perl stores in the @{"_<$filename"} array at compile time.


text:
Shortest code to produce infinite non-periodic output
Not a dupe to this. That question asks specifically for counting up forever, while this question allows many other approaches.
Write a program or function which, given infinite time and memory, would print an infinite non-periodic output.
Clarifications

'Infinite' means the solution keeps outputting something without any further inputs or operations after successfully started the program or function.
'Non-periodic' means the output has no possibility of eventually repeating the same section forever (regardless of how long that period is). An example of a valid solution would be printing the digits of an irrational number.
Random solutions would not count unless you can prove that it fits the requirements. Date/time-based solutions may also be invalid if they are not stored with arbitrary precision.

Winner
Shortest code (in bytes) wins.

Regarding non-cyclic, is 1\n12\n123 invalid?

Not a dupe. Though one method is to count up forever, the question here is to output a unique number forever, not specifically counting up forever. How people answer question isn't exactly the question.

@no1xsyzy I voted to reopen your question.

I edited your post for clarity. Feel free to undo any changes you don't agree with.

So, is infinite precision required or not? It's not made super clear in the question.

There are a lot of counting answers given. Besides the arbitrary precision ones, won't some of them overflow their number type and stop printing or start to repeat? Or, as mbomb007 asked, is this limitation allowed or not?

I am confused there are no answers containing complex numbers around

Is it allowed for the program to produce infinite non-periodic error messages?

@PizgenalFilegav https://codegolf.meta.stackexchange.com/a/2451/66043 I think so.

Hexagony, 2 bytes
(!

Try it online!
The unfolded source code looks like:
 ( !
. . .
 . .

This just runs these two commands in a loop, which are decrement (() and print (!). Hence, the output is:
-1-2-3-4-5-6-7-8-9-10-11-12...

We need to use decrement instead of increment to ensure that the program loops back to the first line (if the memory value was positive, Hexagony would loop between then second and third line, and end up in an infinite loop without doing anything).

What happens when Hexagony reaches its smallest representable integer?

@Adám Hexagony uses arbitrary-precision integers.

Python 2, 23 bytes
while 1:print id;id=id,

Try it online!
Prints
<built-in function id>
(<built-in function id>,)
((<built-in function id>,),)
(((<built-in function id>,),),)
((((<built-in function id>,),),),)

and so on. Starts with the built-in function id, the shortest pre-initialized variable name, and repeatedly turns it into a tuple of itself.
In Python 3, this solution is one byte longer because of print(), but the byte can be recovered from print outputting None:
while 1:id=print(id),id

or
while[print(id)]:id=id,

Brachylog, 2 bytes
ẉ⊥

Try it online!
This prints all integers ordered by magnitude. This will never overflow and print already seen integers since  Brachylog uses unbounded integers by default.
Explanation
ẉ      Writeln: the Input is anything, so we label it implicitely to an integer and write it
 ⊥     False: backtrack and try another integer value for the Input

Labyrinth, 3 bytes
#:!

Try it online!
Prints all non-negative even integers without separator:
024681012141618202224262830323436384042...

The IP bounces back and forth on the code, so this is really #:!: in a loop:
#  Push stack depth.
:  Duplicate.
!  Print.
:  Duplicate.

A bunch of alternatives:
:#!     Prints all positive odd integers.
:)!     Prints all positive integers.
):!     Prints all positive integers.
:(!     Prints all negative integers.
(:!     Prints all negative integers.

Bash + coreutils, 6 bytes
yes|sh

Try it online!
Explanation
yes produces an infinite stream of newline-separated ys. | sends the output to sh, which tries to execute it line by line as it arrives. The first y is not valid code, so it produces the error message sh: line 1: y: command not found. The second y is also invalid, but it's part of the same stream (the output from yes), so it's treated as "line 2", making the error message sh: line 2: y: command not found. This continues forever, producing a different error message each time:
sh: line 1: y: command not found
sh: line 2: y: command not found
sh: line 3: y: command not found
sh: line 4: y: command not found
sh: line 5: y: command not found
...

 Haskell - 10 bytes
print[1..]

Although in ghci you could just type [1..] and that would automatically start printing.

Befunge, 4 bytes
1+:.

Try it online!
In Befunge, the stack is bottomless and has infinite zeros. That said:
1+ adds one to the top of the stack
: duplicates the top of the stack
. prints the ascii value of the top of the stack as a number
And it continues infinitely, because there's no @ to stop execution. This is actually one of those problems made easier to solve by the way befunge works... weird.

Is there a Befunge interpreter that uses arbitrary-precision integers?

@MartinEnder Although not strictly spec compliant, I'm fairly sure both Befungee and PyFunge use arbitrary precision integers for their stack cells.

@MartinEnder I'm sorry, I should've noted that in the original response. I think Pyfunge uses arbitrary precision integers, but I'll make sure of it when I get back home

PHP, 20 bytes
for(;;)echo$argc.=0;

Outputs this:
101001000100001000001000000100000001000000001000000000...

If command line arguments are provided, the output will be different, but still non-periodic.
As far as I understand the documentation, the language itself doesn't restrict length of strings.

><>, 3 bytes
l:n
Outputs a stream of numbers, counting from 0.
I believe incrementing numbers don't cycle...
Explanation:
l pushes stack length onto stack
: duplicates top stack value on top of stack
n outputs value as number
When the line is finished it goes back to the beginning, so it does it again, but now the stack is longer...
online

JavaScript, 26 22 20 bytes

for(;;)alert(Date())

(Warning: it's evil)

I would recommend making it so that this code so that it doesn't have the run option.

You can get rid of both the first and last semicolons: for(n=0;;)alert(n++)

I don't know much about javascript but wouldn't this eventually overflow or top out to nan or infinity?

@Ahemone It won't overflow but it will eventually get stuck forever at 2^53 = 9007199254740992.

@Arnauld So this answer is not non-periodic...

can be fixed for 2 extra bytes: for(s="";;)alert(s+=1)

@Jens Can't s+=1 be changed to s++?

no, s starts out as the empty string, s++ turns it into 0 so it starts doing the same thing as your code. s+=1adds the string "1" to  it instead, so it alerts longer and longer strings of all ones

You could just do for(;;)alert(Date()) for 20 bytes.

7, 2 bytes
The characters that make up this program are:
240223

When viewing the file in an editor, it'll likely try to interpret it as ASCII, in which case it looks like this:
P$

Try it online!
The program takes input. I've assumed here that the input is at EOF; if you provide it input, it's possible it will crash.
Explanation
Zeroth iteration

240223
240223  Append 240223 to the top stack element

The entire program here is passive, so it'll append an active version of itself to the top stack element (which is initially empty). The program's in an implicit loop, which evaluates the top stack element (while leaving it on the stack) every iteration. So the active version will run. (Pretty much all 7 programs start like this.)
First iteration

240223
2       Copy the top stack element
 40     Escape the second stack element, swapping it to the top
   2    Copy the top stack element
    23  Output the top stack element

Before the output command, the stack contains two copies of 240223 (i.e. passive). The top one gets output (with no observable effect other than selecting output format 2, "numbers"), the one below stays and becomes the program for the next iteration.
Second iteration

240223
240223  Append 240223 to the top stack element

The same as the zeroth iteration, right? Not quite; the stack had different contents. The stack is now 240223 below 240223240223.
Third iteration

240223240223
240223        Append 240223 to the top stack element
      2       Copy the top stack element
       40     Escape the second stack element, swapping it to the top
         2    Copy the top stack element
          23  Output the top stack element

This outputs a stack element that has three more 6s-and-0s than it does 7s-and-1s. Output format 2 interprets this as a request to input a number. We read EOF, with the consequence that the next element on the stack is reduced to a zero-length string. However, due to a bug (which seems mildly useful and may be promoted to a feature?), this only happens after it starts executing. The stack once again has two elements, 240223 below 240223240223240223, but the escaped version of this top element, 72402236240223240223, is now executing.
Fourth iteration

72402236240223240223
72402236240223240223  Append 240223240223240223 to the top of stack

The top of stack was a zero-length string, so we're basically just unescaping the program that ended up there.
Fifth iteration

240223240223240223
240223              Append 240223 to the top stack element
      2             Copy the top stack element
       40           Escape the second stack element, swapping it to the top
         2          Copy the top stack element
          23        Output the top stack element
      2       Copy the top stack element
       40     Escape the second stack element, swapping it to the top
         2    Copy the top stack element
          23  Output the top stack element

This is very similar to the third iteration. There are two changes, though. First, there are now 4 more 0s-and-6s than there are 1s-and-7s, so we'll try to input a character from standard input rather than a number. We still get EOF, though, and still end up reducing the top of stack to a zero-length string as a result. Next, there's code running after the reduction, so the next iteration doesn't start immediately. Rather, we do a bunch of operations on that zero-length element, ending up with three zero-length elements. We output one, the other two disappear (because it's the end of an iteration), and we end up basically where we were at the end of the third iteration.
Sixth iteration
The program we copy from the top of stack is now 240223240223240223240223. Everything works like in the previous iteration until we reach the first output instruction (the first 23). This now has five more 0s-and-6s than there are 1s-and-7s, so it sets a mode in which the next output instruction will be interpretted as a request to change the output format. This also leads to a notable change in behaviour; as there was no input request, we didn't read EOF, and thus didn't trigger the consequence of reading EOF (the new top stack element being blanked), and as such the escaped version of the original stack element stays rather than being removed. This means that the next 2402 is no longer a no-op, creating two escaped copies of the escaped stack element (i.e. they're now double-escaped). We output one, setting the output format to 7 ("same as the input"); this output format has no I/O commands, and no commands to change the format, so we'll stay in it for the rest of the program. We also output 724022362402232402232402232402236 (in the same encoding as the input) to standard output.
Anyway, it's fairly clear what the program's going to be doing from this point onwards: it's a combination of appending various number of copies of variously escaped 240223 to the top of the stack, escaping the top of the stack, and outputting copies of the top of the stack. From this point onwards, the top stack element is never cleared (because we never read EOF), so it just grows and grows and grows. The periodic escaping ensures that the output never repeats (because it means that each iteration, the first output starts with at least one more 7 than it did on the previous iteration).

Brainfuck, 13 Bytes, assuming no upperbound but output mod 256
+[[->+++.<]>]

output char code 2 2 4 6 2 4 6 8 10 12 14 16 18 ...
sorry that the old code print loop 0 2 4 6 ... 254,
Brainfuck, 13 12 Bytes (-1 from Jo King)
+[[>.]<[<]+]

output char code 0 1 0 1 1 0 1 1 1 0 ...

Why not combine the [.>]. into [>.]? +[[>.]<[<]+] prints 010110111011110...

Do you have an interpreter that meets the specifications required to make this non-periodic?

http://esoteric.sange.fi/brainfuck/impl/interp/i.html with code +[[>.]<[<],] and fill input bar with '\1'

@WheatWizard I don't know about the first one, but for the second TIO will show a square for 1 and a blank space for 0

I was particularly talking about the first one. You can't have a language without an interpreter. That being said you can always make an interpreter.

i.html with large number checked goes for 1st but no %256(so I can write +[.+]?

Oh seem it mod 65536

Bourne Shell, 11 bytes
yes date|sh

Ohm, 4 bytes (CP437)
¼,¡∞

Prints the counter variable, increments it, and goes into an infinite loop! Simple enough.
EDIT (Mar 1 '17): While I was in the process of doing some other updates (after I posted this answer), I changed the behavior of ∞. The updated answer would be ∞^,.

MATL, 4 bytes
`@tD

This solution creates a while loop which pushes the index of the loop to the stack, duplicates it, prints the value and then checks that the loop index is non-zero to repeat again.
Try it Online!

"modern" DC, 9 bytes
Infinite memory?
Then a continuously growing stack is ok?
]:-)
[zprdx]dx

Commented:
[         # start string constant
 z        #   push current stack depth
  p       #   print TOS without removing
   r      #   swap TOS and NOS
    d     #   duplicate TOS
     x    #   pop TOS and interprete it
      ]   # end string constant, push it
       d  # duplicate TOS
        x # pop TOS and interprete it

Because of using the r command, this will not run on some anicent DCs.

RProgN 2, 13 bytes
2{22.`2=2p2}:

There are many twos in the output, separated by progressively more sparce newlines.
2{22.`2=2p2}:
2               # Push a two to the stack
 {         }:   # While the top of the stack is truthy
  22.           # Push the value of "2" twice, and concatenate them together.
     `2=        # Set the value of "2" to this.
        2p      # Print the value of "2"
          2     # And push the value of "2"

Which prints 2^n 2s followed by a newline for each iteration.
Try it online!

I remember you saying Stacked was too verbose? ;)

C (gcc), 83 81 bytes
*p,*t,*g;f(){for(t=p=malloc(1),g=--t;t<p?putchar(55):(t=g,*p++,putchar(9));t++);}

First allocating a pointer on the heap, the function then counts off into the memory addresses ahead until a segfault from *p++, therefore is limited by the amount of memory in the system rather than the data types used which would otherwise eventually overflow and repeat the series. Given infinite memory with infinite addressing capability it would go on forever.
Try it online!

Saw "Answered 1 min ago by Ahemone", and was excited because I instantly knew it was a C answer!

@AlbertRenshaw I'm glad you enjoy them. I've just realised though, I should be dereferencing the p++ to make my claim.

65 bytes

APL (Dyalog APL), 8 bytes
{∇⎕←0⍵}1
{emsp;an anonymous function...
 ∇ recurse on
 ⎕ ← output to STDOUT
 0 ⍵ the two element list consisting of a zero and the argument
} applied to the number one
This outputs (on separate lines) [0,1], [0,[0,1]], [0,[0,[0,1]]], etc.

Processing, 30 29 bytes
1 byte saved thanks to QwerpDerp for using millis() instead of frameRate
void draw(){print(millis());}

Continuously prints the number of milliseconds since the start of the program.
Sample output:
3573743914054244404574734925085205375585755916...

Jelly, 3 bytes
‘Ȯß

Try it online! - truncates the output and raises an error, but will go far longer locally (until memory runs out).
With an implicit input of zero this program consists of a single link which increments, ‘, prints Ȯ, and then calls itself with the new value, ß.

TI-Basic, 11 Bytes
While 1
Ans+1
Disp Ans
End

Don't you get an error when numbers get too big?

I am assuming infinite memory in float sizes and precision.

Perl 6, 11 bytes
say($++)xx*

Prints the natural numbers.
Try it online!

Python 2, 24 bytes
Prints 9 times each power of 2.
n=9
while 1:print n;n+=n

Try it online

9 times powers of 2? Are you trying to be as weird as possible? If so, I recommend while n:.

@CalculatorFeline That doesn't change the output. But yes, I didn't want to just print every positive integer. This way shows that the integers are arbitrary precision as required, because the output grows quickly.

Batch, 7 bytes
time|%0

Or:
%random%|%0

The latter might repeat, it being random

Powershell, 19 Bytes
Boring counting up answer.
for(){[bigint]$i++}

Improved version of answer from Count Up Forever

stacked, 9 bytes
$out0 ani

Try it online! Similar to my Count up forever answer, this outputs natural numbers from 0, the counter.

GNU sed, 13 bytes
This is an arbitrary precision counter in unary. That's a fancy way of saying that I append one 0 to the pattern space and print it on every iteration (infinite loop).
:
s:0*:&0:p
b

After some time this would normally run into a memory allocation error and stop printing, because it can't store anymore the ever growing pattern space. That's not a problem for this challenge, since the memory is assumed to be infinite.
Try it online! (this interpreter further limits the available resources by design)
Output preview: only the first 5 lines
me@LCARS:/PPCG$ echo | sed -f infinite_non_periodic.sed | head -5
0
00
000
0000
00000

OIL, 11 9 bytes
4
6
8
6
6

First prints what's in cell 6 (0), then increments cell 6 and jumps to the beginning. The reference implementation of OIL uses arbitrary precision integers, so this will (in theory) run forever. This is probably the shortest possible such program in OIL.
edit: Realized I can remove the final zero and it will still work.

Ruby, 21 12 bytes
loop{p$.+=1}

Print all natural numbers.
As far as I understand the problem description, this should be ok.

PHP, 21 bytes
for(;;)echo uniqid();

Usage: php -r "for(;;)echo uniqid();"
Outputs unique IDs based on the current time in microseconds:
    58b3e065e4b4c58b3e065e4b6358b3e065e4b7b58b3e065e4b9458b3e065e4bac58b3e065e4bc458b3e065e4bdc58b3e065e4bf558b3e065e4c0e58b3e065e4c2658b3e065e4c3e58b3e065e4c5658b3e065e4c6f58b3e065e4c8758b3e065e4c9f...
as a continuous sequence of: 58b3e09390617 58b3e09390651 58b3e0939068a 58b3e093906c3 58b3e093906fc ...

While it's very unlikely, it's not impossible that this ends up looping if you happen to go through the values with the exact same timing after that number wraps around. The challenge is very clear that there should be no possibility at all that the output could be periodic.

@MartinEnder you mean the script could output two same consecutive values in the case that the microtime will be the same for two outputs? (very fast execution)

No, I was under the impression that the output of uniqid has a fixed length. So if you let the program run for long enough that string will overflow and start from the beginning. Then at some point it will hit the initial timing and the in principal could output the exact same sequence of IDs again. That said, if you can show that the length isn't fixed, this should be fine.

@MartinEnder ´uniqid´ should output an id based on the current time, in this format: first 8 characters are unix time and the last 5 are microseconds, so I think it will go on virtually forever without any string overflow or duplication. Or am I missing something obvious? (I'm not a computer scientist though...)

If the length is fixed to 13 characters it has to overflow at some point, because there is only a finite number of possible values.

@MartinEnder Ok I understand what you say, my previous answers I gave I was giving as granted that the number of characters would increase as time increases too (i.e. in year 102017 maybe uniqid would output 15 caracters string and not 13). I tried to make some experiments and find some more in-depth specs but couldn't find any since now. The docs says it will output 13 characters string btw but I don't know how it works with bigger dates... I'll keep looking anyway and write here if I find anything.

Sesos, 2 bytes
SASM
set numout
jmp, put, add 1

SBIN
00000000: c40a                                              ..

Prints all non-negative integers in order.
Try it online!

Will this reach a max integer and overflow, or does sesos use arbpreints?

In the absence of the set mask directive, Sesos uses arbitrary precision integers.

Tcl, 23 bytes
while 1 {puts [incr i]}

Try it online!

Aceto, 5 bytes
dp
I<

Increments the top element (initially zero), duplicates the resulting element, pops and prints it, and goes back to the start.

Mathematica, 17 bytes
i=0;#0@Print@++i&

or (more interesting version, 1 byte longer)
#0@Print@Unique[]&

Recursive forever (assuming $MaxRecursionLimit = Infinity)
This version is 24 byte.
i=0;While[1>0,Print@++i]

Triangular, 6 bytes
(.i]%<

Formats into this triangle:
  (
 . i
] % <

Prints an infinite stream of numbers starting from 0. The code that is executed (after removing directionals and no-ops) is (i%] - basically, starts a loop, increments the top of stack, prints it, and jumps back to the loop.
Try it online!

05AB1E, 3 bytes
[N,

Counts up forever.
Try it online!

PHP, 19 bytes
for(;;)echo$s.=0,1;

Run with -r or -R.

Java 8, 82 bytes
o->{java.math.BigDecimal t=null;for(t=t.ONE;;System.out.println(t=t.add(t.ONE)));}

Perhaps a bit boring considering the other challenge, but this loops up forever, starting at 2.
Has an unused Object parameter (which is null), since the challenge doesn't specifically ask for "no input".
Explanation:
Try it here. (It's a cache after it has timed out after 60 seconds the first time.)
o->{                            // Method with empty Object parameter and no return-type
  java.math.BigDecimal t=null;  //  Create BigDecimal once so we can use it's static fields
  for(t=t.ONE;                  //  Start at 1
      ;                         //  Loop infinitely
      System.out.println(       //   And print `t`
        t=t.add(t.ONE)          //    after we've raised `t` by 1
      )
  );                            // End of loop
}                               // End of method

Pushy, 3 bytes
[H"

Try it online!
[     \ Infinitely:
 H    \  Push 100 ('d')
  "   \  Print whole stack (with trailing newline)

Ah yes. H pushes d.

@Makonede its pretty common in esolangs for H to represent 100 and for types to be flexible (hence the  100 <=> "d" conversion)

I know, it's just funny

Husk, 1 byte
N

Try it online!

05AB1E, 1 byte
∞

Try it online!
∞  # [1, 2, ..., ∞]
   # implicit output

Thunno 2, 3 bytes
1Ƙ£

Attempt This Online!
Prints the infinite list of positive integers.