Skip to content

Instantly share code, notes, and snippets.

View zyxar's full-sized avatar
👑
I may be slow to respond.

Markus zyxar

👑
I may be slow to respond.
  • Singapore
View GitHub Profile

Keybase proof

I hereby claim:

  • I am zyxar on github.
  • I am matzoe (https://keybase.io/matzoe) on keybase.
  • I have a public key whose fingerprint is 433F 3849 9B9E FECA 29E1 E8B4 CC55 042D E4A5 6CB1

To claim this, I am signing this object:

@zyxar
zyxar / FrameIO.cc
Last active June 8, 2016 07:46
FFMEPG FrameIOContext
#include "FrameIO.h"
#include <stdexcept>
FrameIOContext::FrameIOContext(FILE* in)
: m_file{ in }
, m_inputCtx{ avformat_alloc_context() }
, m_outputCtx{ nullptr }
, m_ioCtx{ avio_alloc_context(
reinterpret_cast<unsigned char*>(av_malloc(BufferSize)), BufferSize,
0, m_file, &FrameIOContext::mem_read, nullptr, &FrameIOContext::mem_seek) }
@zyxar
zyxar / Argument.cc
Created May 25, 2016 14:51
shared_arguments
// Copyright 2016 Markus Tzoe
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@zyxar
zyxar / rtsp_muxer.cc
Created May 12, 2015 08:11
rtsp_muxer
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
extern "C" {
#include <libavformat/avformat.h>
#include <libavutil/avstring.h>
}
#define RS 8
#define EN 9
#define backlight 10
#define RS_L digitalWrite(RS,LOW)
#define RS_H digitalWrite(RS,HIGH)
#define EN_L digitalWrite(EN,LOW)
#define EN_H digitalWrite(EN,HIGH)
// commands
@zyxar
zyxar / app.js
Last active September 11, 2018 05:40
WebRTC <-> SIP <-> WebRTC
var express = require('express');
var app = express();
app.configure(function () {
"use strict";
app.use(express.logger('dev'));
app.use(express.static(__dirname + '/public'));
});
app.use(function (req, res, next) {
@zyxar
zyxar / install.md
Created March 28, 2014 00:37
[Kamailio + OverSIP] server deployment

Kamailio + OverSIP server deployment

OverSIP

  • Edit your /etc/apt/sources.list:

    deb http://deb.versatica.com precise main
    
@zyxar
zyxar / shooter.js
Last active August 29, 2015 13:57
subtitle download helper via shooter.cn - now in `npm`:
// install via `npm install -g shooter`
(function () {
var http = require('http');
var fs = require('fs');
var api = {};
var file_hash = '';
var file_name = '';
api.getHash = function (filename) {
var crypto = require('crypto');
@zyxar
zyxar / conn.js
Last active December 20, 2015 01:09
日月光华原地满血复活脚本
var fs = require('fs');
var list = fs.readFileSync('login.lst').toString();
list = list.replace(/\n/g, ' ');
var cookies = {};
var http = require('http');
var qs = require('querystring');
var events = require('events');
var emitter = new events.EventEmitter();
var Login, Logout;
@zyxar
zyxar / WebIM.js
Last active December 15, 2015 12:19
WebIM.js?20130110
var mainPageUrl = "main.aspx";
var loginPageUrl = "login.aspx";
var addBuddyUrl = "WebIM/AddBuddy.aspx?Version={0}";
var getConnectUrl = "WebIM/GetConnect.aspx?Version={0}";
var getContactInfoUrl = "WebIM/GetContactInfo.aspx?UserType={0}&UserValue={1}&Version={2}";
var getContactListUrl = "WebIM/GetContactList.aspx?Version={0}";
var getGroupListUrl = "WebIM/GetGroupList.aspx?Version={0}";
var getGroupPortraitUrl = "WebIM/GetGroupPortrait.aspx?Uri={0}&Size={1}&Crc={2}&mid={3}";
var opInviteJoinUrl = "WebIM/PGHandleInviteJoinGroup.aspx?Version={0}";
var PGHandleApplicationUrl = "WebIM/PGHandleApplication.aspx?Version={0}";