Skip to content

Instantly share code, notes, and snippets.

@ungoldman
ungoldman / curl_post_json.md
Last active Jan 26, 2020
post a JSON file with curl
View curl_post_json.md

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@aldgagnon
aldgagnon / .block
Last active Jan 26, 2020
d3-ontario-wmu-map
View .block
license: gpl-3.0
height: 950
scrolling: no
border: yes
View Ambiente Windows.md

Ambiente Windows

Vamos configurar nosso ambiente de desenvolvimento, instalando ferramentas básicas para iniciarmos no mundo da programação.

Instalar Chocolatey

Chocolatey é um gerenciador de programas e nos ajudará a instalar os programas de maneira programática, pelo terminal do Windows.

  1. Abra o PowerShell como administrador ( clique com o botão direto do mouse no ícone do PowerShell e procure a opção Abrir como Administrador )
  2. Coloque o código abaixo e dê ENTER
@shortjared
shortjared / list.txt
Last active Jan 26, 2020
List of AWS Service Principals
View list.txt
acm.amazonaws.com
alexa-appkit.amazon.com
apigateway.amazonaws.com
application-autoscaling.amazonaws.com
appstream.application-autoscaling.amazonaws.com
appsync.amazonaws.com
athena.amazonaws.com
autoscaling.amazonaws.com
batch.amazonaws.com
channels.lex.amazonaws.com
View app.R
library(shiny)
# MODULE UI
customInputUI <- function(id) {
ns <- NS(id)
verbatimTextOutput(ns("debug"))
}
# MODULE SERVER
# Render the custom shiny input binding
@onetransistor
onetransistor / bluepill.ioc
Created Sep 18, 2018
STM32CubeMX Project for STM32 blue pill development board
View bluepill.ioc
#MicroXplorer Configuration settings - do not modify
File.Version=6
KeepUserPlacement=false
Mcu.Family=STM32F1
Mcu.IP0=NVIC
Mcu.IP1=RCC
Mcu.IP2=RTC
Mcu.IP3=SYS
Mcu.IP4=USB
Mcu.IPNb=5
@contra
contra / gtfs-feeds.json
Created Aug 26, 2018
huge collection of gtfs and gtfs-rt feeds, updated regularly
View gtfs-feeds.json
[{"id":"roam-transit/953","type":"gtfs","name":"Roam Transit GTFS","raw":"http://data.trilliumtransit.com/gtfs/roamtransit-banff-ab-ca/roamtransit-banff-ab-ca.zip","location":{"type":"Point","properties":{"name":"Banff, AB, Canada","shortName":"Banff"},"coordinates":[-115.570769,51.178363]}},{"id":"mission-bay-tma/952","type":"gtfs","name":"Mission Bay TMA GTFS","raw":"http://data.trilliumtransit.com/gtfs/missionbay-ca-us/missionbay-ca-us.zip","location":{"type":"Point","properties":{"name":"San Francisco, CA, USA","shortName":"San Francisco"},"coordinates":[-122.419415,37.774929]}},{"id":"avalon-transit/951","type":"gtfs","name":"Avalon Transit","raw":"http://data.trilliumtransit.com/gtfs/avalon-ca-us/avalon-ca-us.zip","location":{"type":"Point","properties":{"name":"Santa Catalina Island, California 90704, USA","shortName":"Santa Catalina Island"},"coordinates":[-118.41631,33.387886]}},{"id":"blue-grass-ultra-transit-service/950","type":"gtfs","name":"Blue Grass Ultra-Transit Service GTFS","raw":"http://dat
@nl5887
nl5887 / transfer.fish
Last active Jan 26, 2020
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
View transfer.fish
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@AtulKsol
AtulKsol / psql-error-fix.md
Last active Jan 26, 2020
Solution of psql: FATAL: Peer authentication failed for user “postgres” (or any user)
View psql-error-fix.md

psql: FATAL: Peer authentication failed for user “postgres” (or any user)

The connection failed because by default psql connects over UNIX sockets using peer authentication, that requires the current UNIX user to have the same user name as psql. So you will have to create the UNIX user postgres and then login as postgres or use sudo -u postgres psql database-name for accessing the database (and psql should not ask for a password).

If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres (as pointed out by @meyerson answer) will solve your immediate problem.

But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf* line:

from

You can’t perform that action at this time.