<commit_before>/* Copyright (c) 2014-2015, <NAME> <<EMAIL>> */
/* See LICENSE for licensing information */

package main

import "html/template"

var tmpl *template.Template

func loadTemplates() {
	for name, s := range templates {
		var t *template.Template
		if tmpl == nil {
			tmpl = template.New(name)
		}
		if name == tmpl.Name() {
			t = tmpl
		} else {
			t = tmpl.New(name)
		}
		if _, err := t.Parse(s); err != nil {
			panic("could not load templates")
		}
	}
}

var templates = map[string]string{
	"/": `<html>
<body>
<pre>
Set up an alias:

    $ alias pcat='curl -F "{{.FieldName}}=&lt;-" {{.SiteURL}}'

Upload a new paste:

    $ echo foo | pcat
    {{.SiteURL}}/a63d03b9

Fetch it:

    $ curl {{.SiteURL}}/a63d03b9
    foo

You can also use the <a href="form">web form</a>.
{{if gt .MaxSize 0.0}}
Maximum size per paste is {{.MaxSize}}.
{{end}}{{if gt .LifeTime 0}}
Pastes will be deleted after {{.LifeTime}}.
{{end}}
<a href="http://github.com/mvdan/pastecat">github.com/mvdan/pastecat</a>
</pre>
</body>
</html>
`,
	"/form": `<html>
<body>
	<form action="{{.SiteURL}}" method="post" enctype="multipart/form-data">
		<textarea cols=80 rows=24 name="{{.FieldName}}"></textarea>
		<br/>
		<button type="submit">Paste text</button>
	</form>
	<br/>
	<form action="{{.SiteURL}}" method="post" enctype="multipart/form-data">
		<input type="file" name="{{.FieldName}}"></input>
		<br/>
		<button type="submit">Paste file</button>
	</form>
	<p>{{.LimitDesc}}</p>
</body>
</html>
`,
}<commit_msg>Remove limits from the form page<commit_after>/* Copyright (c) 2014-2015, <NAME> <<EMAIL>> */
/* See LICENSE for licensing information */

package main

import "html/template"

var tmpl *template.Template

func loadTemplates() {
	for name, s := range templates {
		var t *template.Template
		if tmpl == nil {
			tmpl = template.New(name)
		}
		if name == tmpl.Name() {
			t = tmpl
		} else {
			t = tmpl.New(name)
		}
		if _, err := t.Parse(s); err != nil {
			panic("could not load templates")
		}
	}
}

var templates = map[string]string{
	"/": `<html>
<body>
<pre>
Set up an alias:

    $ alias pcat='curl -F "{{.FieldName}}=&lt;-" {{.SiteURL}}'

Upload a new paste:

    $ echo foo | pcat
    {{.SiteURL}}/a63d03b9

Fetch it:

    $ curl {{.SiteURL}}/a63d03b9
    foo

You can also use the <a href="form">web form</a>.
{{if gt .MaxSize 0.0}}
Maximum size per paste is {{.MaxSize}}
{{end}}{{if gt .LifeTime 0}}
Pastes will be deleted after {{.LifeTime}}
{{end}}
<a href="http://github.com/mvdan/pastecat">github.com/mvdan/pastecat</a>
</pre>
</body>
</html>
`,
	"/form": `<html>
<body>
	<form action="{{.SiteURL}}" method="post" enctype="multipart/form-data">
		<textarea cols=80 rows=24 name="{{.FieldName}}"></textarea>
		<br/>
		<button type="submit">Paste text</button>
	</form>
	<br/>
	<form action="{{.SiteURL}}" method="post" enctype="multipart/form-data">
		<input type="file" name="{{.FieldName}}"></input>
		<br/>
		<button type="submit">Paste file</button>
	</form>
</body>
</html>
`,
}
{'fraction_non_alphanumeric': 0.2103861517976032, 'fraction_numerical': 0.016644474034620507, 'mean_word_length': 3.6806853582554515, 'pattern_counts': {'":': 4, '<': 69, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4677050', 'n_tokens_mistral': 1255, 'n_tokens_neox': 1135, 'n_words': 292}