Skip to content

Instantly share code, notes, and snippets.

@v21
v21 / Extensions.cs
Last active August 29, 2015 14:05
Unity3D new UI convienience extensions
using System.Linq;
using UnityEngine;
using System;
using System.Collections.Generic;
using Debug = UnityEngine.Debug;
using Object = UnityEngine.Object;
using Random = UnityEngine.Random;
using UnityEngine.EventSystems;
using UnityEngine.Events;
@d-baker
d-baker / vocab-template.txt
Last active August 29, 2015 14:10
starting points for learning a new language (or designing one)
PHRASES
Hello
Goodbye
Sorry
Thankyou
Yes
No
How are you?
Goodnight
Good morning
quinlan@corinthian:~/.weechat/logs$ grep -E '\w+[A]{3,}[a]*$' irc.esper.#merveilles.weechatlog | sed -E 's/[[:space:]].*//' | sort | uniq -c | sed -E -e 's/^[[:space:]]*//' | gnuplot -e 'set terminal dumb 120 40; set grid; set datafile separator " "; set xdata time; set timefmt "%Y-%m-%d"; plot "< cat" using 2:1 with lines title ""'
25 ++-+---+--+--+---+--+---+--+--+---+--+--+---+--+--+---+--+---+--+--+---+--+--+---+--+--+---+--+--+---+--+---+-++
+ + + + + + + + + + +* +
| : : : : : : : : : :* |
| : : : : : : : : : :* |
| : : : : : : : : : :* |
| : : : : : : : :
@nijotz
nijotz / lolbow.txt
Created June 9, 2016 19:08
LOLBOW winners
[4800x0C:07:19nick@nijotz~/.weechat/logs]$ grep -B1 LOLBOW irc.freenode.#infoforcefeed.weechatlog | grep -Ev '(LOLBOW|--)' | awk '{print $3}' | sort | uniq -c | sort -nr
24 cblgh
17 nijotz
17 jnerula
14 Pilate
12 trinque
11 vhost-
11 uptime
11 ben_vulpes
9 lykkin
#!/usr/bin/python
# -*- coding: utf-8 -*-
import errno
import os
import shutil
from subprocess import check_output
import arrow
quinlan@corinthian:~/.weechat/logs$ grep -B1 -rn 'tenyks.*LOLBOW$' ./irc.freenode.#infoforcefeed.weechatlog | grep -v 'LOLBOW' | grep -v '\-\-' | sed -r 's/([0-9 -:]*)(\s*)([a
-zA-Z1-9_-]*)(\s*)lol$/\3/g' | sort | uniq -c > /tmp/matches.txt
quinlan@corinthian:~/.weechat/logs$ cat /tmp/matches.txt
1 437815-2016-03-03 03:10:59 tenyks Link title: Urban Dictionary: Lol
1 446223-2016-04-05 19:07:17 Xe lol\
1 466876-2016-06-09 15:13:39 nijotz BimboTea
1 469408-2016-06-24 23:06:43 dm lol me bb
1 469885-2016-06-27 14:35:13 lykkin lol that's a good typo
1 525127-2017-02-28 16:05:48 [2017]
1 527824-2017-03-14 19:15:10 [2017]

Errmojis

Users have a hard time dealing with errors.

To solve that, put these emojis prominently in your error messages. Then when the user says:

I dont know what happened but I saw a christmas tree and then everything stopped working

You'll know it was an internal error!

So, as I mentioned last time, I have two fundamental goals with dat that are not addressed by simply running dat share.

  • Uptime: making sure that the site is seeded even if my local laptop is closed, eaten by a bear, or disconnected from the internet
  • Resilience: ensuring that there's a way to restart my website if the original seeding computer is lost. I try to make everything on my primary work/personal computer work in such a way that I can recover it all, easily, onto a new machine if I need to

To break these down a bit more, uptime is a combination of two things:

  • Ensuring that there are seeders
  • Ensuring that those seeders are seeding, and they're up-to-date
@dwblair
dwblair / Readme.md
Last active July 10, 2019 00:20
Testing out substack's "ACK' functionality for hypercore!

testing out ACKs in hypercore

Using substack's 'ack' branch of hypercore, you can set an 'ack' flag to 'true' when creating a hypercore replication feed, and you'll be able to tell, for any given hypercore log block you append to a hypercore feed, whether it has been received by a peer.

As a test, I ran "node testsend.js" below ... which generates a public key [KEY], and allows me to type messages into the terminal 'live'. In another directory, I ran "node testreceive.js [KEY]" in order receive those messages ...

Here's what it looked like on the 'send' side as I typed in new messages (I'm including a snippet after I'd already been testing a while) ...

2019-07-06T23:03:14.746Z> bubbles
@nicooprat
nicooprat / grid.less
Last active August 1, 2019 09:07
First try to port Unsemantic to LESS. (http://unsemantic.com/)
// http://unsemantic.com/
// -------------------
// Variables
// -------------------