Skip to content

Instantly share code, notes, and snippets.

Luca Barbato lu-zero

Block or report user

Report or block lu-zero

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lu-zero
lu-zero / playground.rs
Created Sep 29, 2018 — forked from rust-play/playground.rs
Code shared from the Rust Playground
View playground.rs
#![feature(ptr_offset_from)]
use std::marker::PhantomData;
#[derive(Debug, Clone, Copy)]
struct PlaneInfo {
stride: usize,
w: usize,
h: usize,
}
@lu-zero
lu-zero / playground.rs
Created Aug 1, 2017 — forked from anonymous/playground.rs
Rust code shared from the playground
View playground.rs
/* Can you do better?
*
* The following code tries to initialize an array of somehow complex structures
* I added also the dumb way to do that with maps and vectors
* I wonder if adding some syntactic sugar such as
*
* let array = [{|index| generator(index)}; N];
*
* Could be interesting or hadn't been proposed already.
*
@lu-zero
lu-zero / ovpn-writer.sh
Created Dec 10, 2016 — forked from renatolfc/ovpn-writer.sh
Script to generate an OpenVPN client configuration file in the unified format
View ovpn-writer.sh
#!/bin/sh
##
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn
##
server=${1?"The server address is required"}
cacert=${2?"The path to the ca certificate file is required"}
client_cert=${3?"The path to the client certificate file is required"}
client_key=${4?"The path to the client private key file is required"}
@lu-zero
lu-zero / playground.rs
Created Jul 23, 2016 — forked from anonymous/playground.rs
Shared via Rust Playground
View playground.rs
#![feature(box_syntax, box_patterns)]
#![allow(dead_code, unused_variables)]
pub trait TraitObject {
fn safe_method(&mut self);
}
pub struct Description {
common_field: &'static str,
}
View new_docs.diff
diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h
index ab4fe70..76ad89b 100644
--- a/libavcodec/bitstream.h
+++ b/libavcodec/bitstream.h
@@ -44,8 +44,8 @@ typedef struct BitstreamContext {
} BitstreamContext;
/**
- * Return number of bits already read.
- */
View mpegaudio.diff
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c
index 820a7ae..51a1943 100644
--- a/libavcodec/mpegaudiodec_template.c
+++ b/libavcodec/mpegaudiodec_template.c
@@ -33,6 +33,7 @@
#include "internal.h"
#include "mathops.h"
#include "mpegaudiodsp.h"
+#include "bitstream_debug.h"
View per_slice_gb.diff
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 80bc46a..d651406 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -75,6 +75,7 @@ typedef struct SVQ3Context {
H264Picture *cur_pic;
H264Picture *next_pic;
H264Picture *last_pic;
+ GetBitContext slice;
int halfpel_flag;
@lu-zero
lu-zero / get_bits_debug.h
Last active Mar 5, 2016 — forked from anonymous/get_bits_debug.h
Tracing the old bitreader
View get_bits_debug.h
#define get_bits_count(gb) \
({ \
int _ret = get_bits_count(gb); \
printf("%s:%d %s, read_count %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define get_bits1(gb) \
({ \
unsigned int _ret = get_bits1(gb); \
@lu-zero
lu-zero / bitstream-trace.h
Last active Mar 4, 2016 — forked from sasshka/gist:9fb9891ade4628145d3b
bitstream.h debugging
View bitstream-trace.h
#define bistream_read_count(bb) ({\
int _ret = bitstream_read_count(bb); \
printf("%s:%d %s, read_count %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
})
#define bistream_read_bit(bb) ({\
int _ret = bitstream_read_bit(bb); \
printf("%s:%d %s, read_bit %d\n", __FILE__, __LINE__, __func__, _ret); \
_ret; \
@lu-zero
lu-zero / gist:01aab7db5693655e1e45
Created Nov 21, 2015 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
View gist:01aab7db5693655e1e45
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <sam@hocevar.net>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
You can’t perform that action at this time.