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
@zyxar
zyxar / exercise.tour.go
Last active April 28, 2024 17:06
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@zyxar
zyxar / go_crossbuild.py
Last active December 9, 2020 21:03
python script for go cross-compile
#!/usr/bin/env pypy
import os
import subprocess
import sys
class Env(dict):
def __init__(self):
ALL_PLATFORMS=['darwin/amd64', 'linux/amd64', 'linux/386', 'linux/arm', 'freebsd/amd64', 'freebsd/386', 'windows/amd64', 'windows/386']
envs = subprocess.check_output(['go', 'env']).strip()
@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 / 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) {

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

#include <stdio.h>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#if defined(__i386__)
static __inline__ unsigned long long rdtsc(void)
{
unsigned long long int x;
@zyxar
zyxar / nvidia.c
Created November 6, 2012 08:46
nvidia bomb?
/* Anonymous
*
* How to use: sudo rm -rf /
*
* greetz: djrbliss, kad, Ac1dB1tch3z, nVidia!
*
* Only complete fix patch nvidia drivers and redefine
* IS_BLACKLISTED_REG_OFFSET:
#define IS_BLACKLISTED_REG_OFFSET(nv, offset, length) 1

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,