Skip to content

Instantly share code, notes, and snippets.

View rnapier's full-sized avatar

Rob Napier rnapier

View GitHub Profile
@h12w
h12w / goclean.sh
Last active August 24, 2021 03:13
golcean.sh does automatic checking on a Go package and its sub-packages.
#!/bin/bash
# The script does automatic checking on a Go package and its sub-packages, including:
# 1. gofmt (http://golang.org/cmd/gofmt/)
# 2. goimports (https://github.com/bradfitz/goimports)
# 3. golint (https://github.com/golang/lint)
# 4. go vet (http://golang.org/cmd/vet)
# 5. race detector (http://blog.golang.org/race-detector)
# 6. test coverage (http://blog.golang.org/cover)
set -e
static OSStatus
SSLVerifySignedServerKeyExchange(SSLContext *ctx, bool isRsa, SSLBuffer signedParams,
uint8_t *signature, UInt16 signatureLen)
{
OSStatus err;
SSLBuffer hashOut, hashCtx, clientRandom, serverRandom;
uint8_t hashes[SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN];
SSLBuffer signedHashes;
uint8_t *dataToSign;
size_t dataToSignLen;
@gngrwzrd
gngrwzrd / fix-xcode.py
Last active December 23, 2015 11:28 — forked from rnapier/fix-xcode
#!/usr/bin/python
#original script by Rob Napier <robnapier@gmail.com>
#updates by github.com/gngrwzrd
#Script to link in all your old SDKs every time you upgrade Xcode
#Create a directory somewhere to store older SDKs in
#Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
#Under those, store the SDKs:
@sambatyon
sambatyon / rgb2yuv.cc
Created February 13, 2012 16:02
Transforms a bitmap int RGB 8:8:8 24bpp into an equivalent YUV420p 4:2:0 12bpp
void Bitmap2Yuv420p(boost::uint8_t *destination, boost::uint8_t *rgb,
const int &width, const int &height) {
const std::size_t image_size = width * height;
boost::uint8_t *y = destination;
boost::uint8_t *u = destination + image_size;
boost::uint8_t *v = destination + image_size + image_size / 4;
boost::uint8_t *r = rgb;
boost::uint8_t *g = rgb + 1;
boost::uint8_t *b = rgb + 2;
@benlodotcom
benlodotcom / MyAVController.h
Last active February 3, 2016 17:45
A little demo snippet that you can use to access directly the camera video in IOS4
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <CoreVideo/CoreVideo.h>
#import <CoreMedia/CoreMedia.h>
/*!
@class AVController
@author Benjamin Loulier