Skip to content

Instantly share code, notes, and snippets.

View glebpom's full-sized avatar

Gleb Pomykalov glebpom

View GitHub Profile
use std::{convert::Infallible, net::SocketAddr};
use hyper::{Body, Request, Response, Server};
use hyper::service::{make_service_fn, service_fn};
use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, SERVER};
const RESP: &str = "Welcome!";
async fn handle(_: Request<Body>) -> Result<Response<Body>, Infallible> {
let mut resp = Response::new(RESP.into());
@glebpom
glebpom / gist:ea25f6452f94a8e6ed66
Created August 9, 2015 00:33
Buildroot config
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2015.08-rc1-00045-gc5e96d8 Configuration
#
BR2_HAVE_DOT_CONFIG=y
BR2_HOSTARCH_NEEDS_IA32_COMPILER=y
#
# Target options
#
@glebpom
glebpom / gist:54a07bed61f44b0c49c3
Created August 9, 2015 00:32
Buildroot x86_64 panic
[ 0.340000] [<ffffffff813d207f>] extract_buf+0x8f/0x120
[ 0.340000] [<ffffffff813d06be>] ? account+0x13e/0x180
[ 0.340000] [<ffffffff813d250b>] ? xfer_secondary_pool+0x1b/0x60
[ 0.340000] [<ffffffff813d219c>] extract_entropy+0x8c/0x1c0
[ 0.340000] [<ffffffff8131a149>] ? vsnprintf+0x109/0x580
[ 0.340000] [<ffffffff81f8520a>] ? tc_action_init+0x55/0x55
[ 0.340000] [<ffffffff81325121>] ? bucket_table_alloc+0x111/0x1b0
[ 0.340000] [<ffffffff813d2586>] get_random_bytes+0x36/0x70
[ 0.340000] [<ffffffff81325121>] bucket_table_alloc+0x111/0x1b0
[ 0.340000] [<ffffffff81f8520a>] ? tc_action_init+0x55/0x55
@glebpom
glebpom / gist:1416991
Created December 1, 2011 14:09
Sequel 3.29.0 bug blame script
#!/usr/bin/env ruby
$:<< File.join(File.dirname(__FILE__), "sequel/lib")
require 'sequel'
require 'rubygems'
gem 'sqlite3'
Sequel::Model.use_transactions = false
module ShouldaContextExtensions
def self.included(base)
base.class_eval do
alias_method_chain :build, :fast_context
alias_method_chain :am_subcontext?, :fast_context
end
end
def fast_context(name, &blk)
@fast_subcontexts ||= []