Home | Zones | Log in | Register

i still want to still want to be a copy of a better programming topic

programming

Nobody
Filtering | Stop Filtering
 ⬇︎ 
Page 1 of /1

i need to add syntax highlighting now that this came out https://github.com/alecthomas/chroma

code test

func (t *Thread) Bump(ctx context.Context, userID string) error {
	table := dynamoTable(ctx, "Threads")
	return table.Update("Zone", t.Zone).Range("ID", t.ID).
		Set("LastPost", time.Now().UTC()).
		Add("Posts", 1).
		AddStringsToSet("Posters", userID).
		AddStringsToSet("Subscribers", userID).
		Value(t)
}
Edited by Tiko at 2018-06-30 18:55:452018-06-30 18:55

hmm quotes get fucked up “test”

afff " "
''

fixed quotes :3

## i have added color~

* it gets fucked up in spoiler tags but i'll fix later
* you gotta do it like GitHub where u specify the language
bird on skateboard

u gotta do the end ticks too

bird on skateboard

nice

bird on skateboard

i should post about programming more

bird on skateboard

ok i’ll start with some of the ‘worst’ code
i decided to not use any js frameworks or dependencies so..
the emoji picker is dynamically generated JS dom manipulation
later on i learned about the <template> tag which i should use instead

function makeEmojiSelector(id) {
	var frag = document.createDocumentFragment();

	var select = document.createElement("select");
	select.onchange = addEmoji.bind(null, id);
	select.id = "emoji-picker-" + id;

	var topVal = document.createElement("option");
	topVal.value = "";
	topVal.textContent = "Add Emoji";
	select.appendChild(topVal);

	var options = [];
	{{range $i, $emoji := $.Zone.EmojisOrDefault}}
		options[{{$i}}] = document.createElement("option");
		options[{{$i}}].textContent = "{{$emoji}}";
		options[{{$i}}].value = "{{$emoji}}";
		select.appendChild(options[{{$i}}]);
	{{end}}

	var cancelVal = document.createElement("option");
	cancelVal.value = "";
	cancelVal.textContent = "Nevermind";
	select.appendChild(cancelVal);

	frag.appendChild(select);
	document.getElementById("emoji-selector-" + id).appendChild(frag);
}
Edited by Tiko at 2019-05-13 23:26:002019-05-13 23:26
bird on skateboard

From: mrtrip at 2019-05-13 23:27:53


select * from links where is_back.is_current

0 rows

bird on skateboard

it happens just not in quotes ;(

bird on skateboard

i should make quotes fancier
i have them just straight up be markdown because i hadn’t figured out how to make custom stuff yet but i got videos and stuff with a custom tag now

bird on skateboard

From: mg++ at 2020-01-22 12:38:55

From: Tiko at 2017-09-23 05:49:18
i need to add syntax highlighting now that this came out https://github.com/alecthomas/chroma

code test

func (t *Thread) Bump(ctx context.Context, userID string) error {
    table := dynamoTable(ctx, "Threads")
    return table.Update("Zone", t.Zone).Range("ID", t.ID).
        Set("LastPost", time.Now().UTC()).
        Add("Posts", 1).
        AddStringsToSet("Posters", userID).
        AddStringsToSet("Subscribers", userID).
        Value(t)
}

this is beautiful and better than ETI

yeah it’d be nice of ETI had it o well

code looks surprisingly ok even with dark mode theme
kewl

Screen Shot 2020-01-22 at 23.58.54.png

Edited by Tiko at 2020-01-22 14:59:192020-01-22 14:59

u gotta specify the programming language after the ticks
like
```go

Edited by Tiko at 2020-01-22 19:27:432020-01-22 19:27
bool checkGay() {
  return true;
}

From: Pook Cat at 2020-01-23 07:42:47

int getNiceNum() {
  return 69;
}

nice

i switched the custom styles page to use <input type=color> and got rid of the one external JS dependency the ‘zone had
yay

Reply:
To reply to this thread, please join this community.
Pages: 1
1 person is reading this thread now.
Thread List | ↑ Top