Skip to content

Instantly share code, notes, and snippets.

View rainbow23's full-sized avatar
🏠
Working from home

rainbow23 rainbow23

🏠
Working from home
View GitHub Profile
@rainbow23
rainbow23 / b.rb
Last active October 17, 2022 07:55 — forked from junegunn/b.rb
b - browse Chrome bookmarks with fzf
#!/usr/bin/env bash
# vim: set filetype=ruby:
# b - browse Chrome bookmarks with fzf
[ $(uname) = Darwin ] || exit 1
which fzf > /dev/null 2>&1 || brew reinstall --HEAD fzf || exit 1
/usr/bin/ruby -x "$0" |
fzf --ansi --multi --no-hscroll --tiebreak=begin |
awk 'BEGIN { FS = "\t" } { print $2 }' |
@rainbow23
rainbow23 / jenkins-port-forwarding.md
Created May 7, 2017 16:55 — forked from carlossless/jenkins-port-forwarding.md
Port Forwarding (8080 -> 80) with `pf` on Mavericks/Yosemite

Jenkins Port Forwarding (8080 -> 80) with pf on Mavericks/Yosemite

This guide is a fork from this gist. I've added minor adjustments to customise these rules to forward connections from an outsite interface like en0.

Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

1. Create the anchor file

Create an anchor file under /etc/pf.anchors/com.jenkins with your redirection rule like:

-(void) registerAdmob
{
NSLog(@"-> registerAdmob initializing Admob start");
UnityViewController* controller = (UnityViewController*)UnityGetGLViewController();
EAGLView* view = (EAGLView*)[controller view];
NSLog(@"EAGLView frame size:(%f, %f)", view.frame.size.width, view.frame.size.height);
CGFloat scaleSize = [UIScreen mainScreen].scale;
NSLog(@"UIScreen scale:%f", scaleSize);
CGFloat screenWidth = view.frame.size.height * scaleSize;
CGFloat bannerWidth = GAD_SIZE_320x50.width;