June 9, 2015
Isao Yagi <[email protected]>
| /*! | |
| * Copyright 2015 Google Inc. All rights reserved. | |
| * | |
| * 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 |
| #!/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-tmux -u 30% --ansi --multi --no-hscroll --tiebreak=begin | | |
| awk 'BEGIN { FS = "\t" } { print $2 }' | |
| update_current_git_vars |
| # Credit http://stackoverflow.com/a/2514279 | |
| for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |
| #!/bin/sh -eu | |
| get_interface() | |
| { | |
| route get 0.0.0.0 2>/dev/null | awk '/interface: /{print $2}' | |
| } | |
| get_ip() | |
| { | |
| ifconfig -r $1 | awk '/inet /{print $2}' |
| // This is a proxy config file that echos the requested server ip and port, by | |
| // using nginx SSIs. Generated on: <!--# echo var="date_local" --> | |
| function FindProxyForURL(url, host) { | |
| // These values are derived from the current request's server/port. | |
| var prefix = 'http://' + '<!--# echo var="arg_prefix" default="reachclient" -->'; | |
| var proxyhost = '<!--# echo var="server_addr" default="dev.pondr.in" -->'; | |
| var proxyport = '<!--# echo var="server_port" default="8000" -->' | |
| if (url.substring(0, prefix.length) === prefix) { |
June 9, 2015
Isao Yagi <[email protected]>
| #!/bin/sh -eu | |
| # https://gist.github.com/isao/c742a5e8d76ad653ad89 | |
| pid=$(adb shell 'ps' 2>&1 | grep com.ericsson.mediaroom.tv3client | awk '{print $2}') | |
| if [[ -z $pid ]] | |
| then | |
| echo 'No process matching "com.ericsson.mediaroom.tv3client"' | |
| exit 1 | |
| fi |