This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nice reader for request.Body | |
func readStream(stream io.ReadCloser) (string, error) { | |
defer stream.Close() | |
body := "" | |
buffer := make([]byte, 4) | |
for { | |
n, err := stream.Read(buffer) | |
if err != nil { | |
if err == io.EOF { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=0 | |
while [ true ] | |
do | |
echo "testing connection localhost:2345" | |
(echo >/dev/tcp/localhost/2345) &>/dev/null && i=0 || i=-1 | |
if [ $i -eq 0 ]; then | |
echo "ready" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package require Pgtcl | |
proc notification { d } { | |
puts "notification from SQL: $d" | |
# Here I expect to see | |
# notification from SQL: this is a payload | |
} | |
set db [pg_connect -conninfo \ | |
[list host=localhost user=test dbname=test password=test]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<div> | |
Here's the template for my-custom-element | |
</div> | |
<script> | |
fetch('https://gist.githubusercontent.com/rianby64/e2a3ebad701b12552938b649655567f8/raw/myjson.json').then(response => response.json()).then(json => { | |
console.log(json); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<body> | |
<button>Fire error</button> | |
<script> | |
'use script'; | |
window.addEventListener('error', e => { | |
console.error('catch error', e); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
.fullwindow { | |
position: absolute; | |
height: 100%; | |
width: 100%; | |
top: 0px; | |
left: 0px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'airblade/vim-gitgutter' | |
Plugin 'othree/yajs.vim' | |
Plugin 'othree/html5.vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific aliases and functions | |
alias nave='~/.nave/nave.sh' | |
alias nstable='nave use stable' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
window.feature = apolog.feature; | |
window.scenario = apolog.scenario; | |
window.step = apolog.step; | |
window.given = apolog.given; | |
window.when = apolog.when; | |
window.then = apolog.then; | |
window.but = apolog.but; | |
window.and = apolog.and; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Andres Rios | |
email = [email protected] | |
[push] | |
default = matching | |
[core] | |
editor = vim | |
[color] | |
ui = true | |
[alias] |
NewerOlder