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
#! /usr/bin/env python3 | |
import asyncio | |
import asyncssh | |
import sys | |
from textual import on | |
from textual.app import App | |
from textual.screen import ModalScreen | |
from textual.widgets import Label, Button, Input, Header, Footer, Log |
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
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
use Text::Template qw/fill_in_file/; | |
use Hash::Merge qw/merge/; | |
use YAML qw/Load LoadFile/; | |
use IO::All; |
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
foo do | |
bar :baz | |
end |
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
require 'excon' | |
class MyApp | |
def doit | |
e = Excon.new('http://google.com') | |
str = '' | |
e.request({ | |
:method => 'GET', | |
:path => '/', | |
:response_block => lambda { |chunk, remaining, total| |
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
require 'eventmachine' | |
def check_checksum | |
# some checksum processing here... let's say it fails | |
raise Exception.new("invalid checksum: 28fad31") | |
end | |
def notify(ev) | |
if ev == :download_complete then | |
check_checksum |
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
def foo | |
yield | |
end | |
def bar | |
foo { | |
raise Exception("correct exception") | |
} | |
end |