Skip to content

Instantly share code, notes, and snippets.

View b9AobJ's full-sized avatar
🙊
crazy on the writting bugs

a'lin b9AobJ

🙊
crazy on the writting bugs
View GitHub Profile
@b9AobJ
b9AobJ / proxy.js
Created June 27, 2019 02:30 — forked from NickNaso/proxy.js
Log or modify the request body in the node-http-proxy before to pass it to the express.js application
/*******************************************************************************
* Copyright (c) 2017 Nicola Del Gobbo
* 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
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
* IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
* MERCHANTABLITY OR NON-INFRINGEMENT.
@b9AobJ
b9AobJ / 0_reuse_code.js
Created August 17, 2017 02:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@b9AobJ
b9AobJ / xcode-clang-vers
Created March 3, 2017 11:39 — forked from yamaya/xcode-clang-vers
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
@b9AobJ
b9AobJ / gist:b9b65c1386ec32c9c1d6796e0bec36a4
Created November 13, 2016 14:24 — forked from ka010/gist:235253db3fccfac53910
Convert an AVFrame to CVPixelbuffer
-(void)getPixelBuffer:(CVPixelBufferRef *)pbuf {
@synchronized (self) {
if(!_pFrame || !_pFrame->data[0])
return;
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
// [NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
// [NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
@(_pFrame->linesize[0]), kCVPixelBufferBytesPerRowAlignmentKey,
@b9AobJ
b9AobJ / OSTypeFourCharCodeToNSString.m
Created November 10, 2016 06:08 — forked from Koze/OSTypeFourCharCodeToNSString.m
OSType, FourCharCode to NSString
// XX is own prefix
NSString *XXStringForOSType(OSType type) {
unichar c[4];
c[0] = (type >> 24) & 0xFF;
c[1] = (type >> 16) & 0xFF;
c[2] = (type >> 8) & 0xFF;
c[3] = (type >> 0) & 0xFF;
NSString *string = [NSString stringWithCharacters:c length:4];
return string;
}
@b9AobJ
b9AobJ / gist:21f78566b50d5516a7c0a3e5b9b77e3a
Created August 17, 2016 06:30 — forked from tomohisa/gist:2897676
Add and Remove ChildViewController
// add child view
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"];
[self addChildViewController:controller];
controller.view.frame = CGRectMake(0, 44, 320, 320);
[self.view addSubview:controller.view];
[controller didMoveToParentViewController:self];
// remove child view
UIViewController *vc = [self.childViewControllers lastObject];
[vc.view removeFromSuperview];