Skip to content

Instantly share code, notes, and snippets.

@Coeur
Coeur / Get iOS MAC address.m
Created November 30, 2011 17:11
Get iOS MAC address #
/* Original source code courtesy John from iOSDeveloperTips.com */
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <net/if_dl.h>
+ (NSString *)getMacAddress
{
int mgmtInfoBase[6];
@rdp
rdp / gist:2502032
Created April 26, 2012 19:04
rgb32 to i420/yv12
int rgb32_to_i420(int width, int height, const char * src, char * dst)
{
unsigned char * dst_y_even;
unsigned char * dst_y_odd;
unsigned char * dst_u;
unsigned char * dst_v;
const unsigned char *src_even;
const unsigned char *src_odd;
int i, j;
@t-mat
t-mat / gist:3683729
Created September 9, 2012 10:43
ポインタの指す先を `decltype` したい

ポインタの指す先を decltype したい

まとめ

Wikipedia の decltype についての記事を見るのがいいよ!

  • T へのポインタ T* p が指す先を decltype(*p) と書くと T& となる
  • T への const ポインタ const T* p が指す先を decltype(*p) と書くと const T& となる
@wobbals
wobbals / AvcEncoder.java
Created October 31, 2012 22:46
MediaCodec encoder sample
package com.opentok.media.avc;
import java.io.IOException;
import java.nio.ByteBuffer;
import android.media.MediaCodec;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
public class AvcEncoder {
@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@voluntas
voluntas / shiguredo_mqtt_broker_log.rst
Last active December 3, 2017 09:50
時雨堂 MQTT ブローカー Akane 開発ログ

時雨堂 MQTT ブローカー Akane 開発ログ

日時

2017-12-03

時雨堂

バージョン

17.6.30

URL

https://shiguredo.jp/

2017 年 6 月 30 日をもって開発/販売を終了しました。

@takezoe
takezoe / export-issues.js
Last active March 20, 2018 15:16
GitBucket Plug-in Example
var plugin = JavaScriptPlugin.define(
'export-issues', '1.0.0',
'Naoki Takezoe',
'https://twitter.com/takezoen',
'Export issues as JSON from REPO_URL/issues/export.'
);
plugin.addRepositoryAction('/issues/export', function(request, response, repository){
var issues = plugin.db().select("SELECT * FROM ISSUE WHERE "+
"USER_NAME ='" + repository.owner() + "' AND " +
@DaveWoodCom
DaveWoodCom / fixXcode6OnElCapitan.sh
Last active September 8, 2023 21:02
Script to fix Xcode 6.x so that it will run on El Capitan
#!/bin/bash
## Copyright (C) 2015 Cerebral Gardens http://www.cerebralgardens.com/
##
## Permission is hereby granted, free of charge, to any person obtaining a copy of this
## software and associated documentation files (the "Software"), to deal in the Software
## without restriction, including without limitation the rights to use, copy, modify,
## merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
## permit persons to whom the Software is furnished to do so, subject to the following
## conditions:
@voluntas
voluntas / webrtc.rst
Last active May 21, 2024 13:55
WebRTC の未来
@JAremko
JAremko / gist:69392f63347b8406ed38
Last active February 20, 2020 00:46 — forked from madmo/gist:8548738
golang websocket over https proxy
func HttpConnect(proxy, url_ string) (io.ReadWriteCloser, error) {
p, err := net.Dial("tcp", proxy)
if err != nil {
return nil, err
}
turl, err := url.Parse(url_)
if err != nil {
return nil, err
}