Skip to content

Instantly share code, notes, and snippets.

@goblin
goblin / callable_test.py
Last active March 29, 2024 11:32
AsyncSSH passphrase callable tester
#! /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
@goblin
goblin / expand.pl
Created February 2, 2013 20:19
moj konfig manadżment
#! /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;
@goblin
goblin / default.rb
Created December 19, 2012 16:22 — forked from anonymous/default.rb
foo do
bar :baz
end
@goblin
goblin / app.rb
Created October 18, 2012 12:36
webmock bug?
require 'excon'
class MyApp
def doit
e = Excon.new('http://google.com')
str = ''
e.request({
:method => 'GET',
:path => '/',
:response_block => lambda { |chunk, remaining, total|
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
def foo
yield
end
def bar
foo {
raise Exception("correct exception")
}
end