Instantly share code, notes, and snippets.

View aposta.txt
31/12/2022
1. homicídios por ano
2. mulheres mortas pelos companheiros
3. fim do foro privilegiado
4. desemprego
5. pib
6. inflação
7. taxa de desmatamento
8. estupros
View blockstack.txt
Verifying my Blockstack ID is secured with the address 1FkaGUxhTuhYsCEjmiruv9sorH1ZDevW5j https://explorer.blockstack.org/address/1FkaGUxhTuhYsCEjmiruv9sorH1ZDevW5j
View check_sig.go
package main [33/492]
import (
"fmt"
"strings"
"golang.org/x/crypto/openpgp"
)
func main() {
View dl.css
dt {
font-weight: bold;
float: left;
min-width: 200px;
text-align: right;
}
dt:after {
content: ':';
margin-right: 10px;
View main.js
window.xtend = require('xtend')
const {h, run, reactive, track, select} = require('.')
var state = reactive({
name: select('.name-type')
.events('change')
.map(e => e.target.value),
desc: select('.desc-type')
.events('change')
.map(e => e.target.value)
View README.md

TO RUN

  1. Modify app.js to use the address of your websocket server instead of ws://ws-server:8088.
  2. Run the websocket server: node ws-server.js
  3. Run an HTTP static file server of your choice: python3 -m http.server 8080
  4. Visit index.html or your HTTP static file server root. Do this on 2 different computers or 2 tabs on the same computer.
  5. The screen is blank. Open the Javascript console and set values for me and other. Do the same on the other computer/tab (but inverting the values this time). Then call connect. After the connection is established you'll be able to call channel.send('message') and see the event logs at the other computer/tab.
View cloudwatch-alarm-to-pushbullet.jq
# POST https://api.pushbullet.com/v2/pushes
# requires 'Access-Token' header
{
device_iden: "<pushbullet device id>",
type: "note",
title: "\(.Message | fromjson | .NewStateValue): \(.Message | fromjson | .AlarmName)",
body: "\(.Message | fromjson | .AlarmDescription) -- \(.Message | fromjson | .NewStateReason) -- \(.Message | fromjson | .StateChangeTime)"
}
View apply-hn-natural-advertising.md

Problem: Advertising is hard, reaching the correct people with advertising is hard -- probably easier with Adwords than in the real world, but still hard --, and is getting harder as more money is spent on internet advertising. At the same time, ad blockers are quickly spreading and maybe will soon kill all the sources of advertising, bad for personal websites, bad for small companies using Adwords.

Solution: Think affiliate marketing. Now think manual advertising contracts (when a blogger or a podcaster explicitly recommends some website or local business in his writing/talking). This tool would combine these two to get some level of automation in the process. It would beat ad blockers, give a personal touch to the advertising and release companies and bloggers from the pain of manually contracting.

How would it work?

(Let's imagine this service is hosted at natural.com, which is obviously not true). Let's see an example. A blogger writes about the topic of fishing for beginner fishers. He has a lot of fi

View apply-masonry.js
var msnry = new Masonry( 'main > section > ul', {
columnWidth: 'li',
itemSelector: 'li',
percentPosition: true,
gutter: 0
})
View README.md

Psto

This is a no-brainer to get your single-post web page up and running. Just have to have Node and NPM installed. Styling is powered by 999.css.

Steps:

  1. Place the below package.json into an empty directory and enter this directory in your command line prompt.
  2. Run npm run scaffold.
  3. Edit domain, title and author in the config section of your package.json. The domain may be either a Surge subdomain or your own (please refer to the Surge docs). If you're going to host your page yourself, you may leave domain empty.