This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [[ "$MYSQL_CONNECTION_URL" == *":13306"* ]]; then | |
# if local db server is enabled (which should be tunneled in by chisel) | |
chmod +x ./chisel | |
./chisel server --reverse --uds --port $PORT --proxy "http://localhost:${FORWARD_PORT:-8081}/" & | |
while true; do | |
# wait for the db server to be ready | |
if (grep -v "rem_address" /proc/net/tcp|grep ':33FA' 1>/dev/null); then | |
echo "Local database started!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gawk version | |
# Remote | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}' | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}' | |
# No Gawk | |
# Local | |
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import com.github.javaparser.JavaParser; | |
import com.github.javaparser.ast.CompilationUnit; | |
import com.github.javaparser.ast.NodeList; | |
import com.github.javaparser.ast.body.MethodDeclaration; | |
import com.github.javaparser.ast.body.TypeDeclaration; | |
import com.github.javaparser.ast.stmt.BlockStmt; | |
import com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Very useful for buck development, since everytime you change something | |
# buck version will change, leading to cache being cleaned and all remote | |
# files will have to be redownloaded again, which takes time. | |
# | |
# Put following line at the end of .buckconfig.local | |
# [download] | |
# proxy_host=localhost | |
# proxy_port=8000 | |
# proxy_type=HTTP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FFMPEG=`which ffmpeg` | |
INFILE=$1 | |
OUTFILE="${INFILE}.gif" | |
TMPFILE="${INFILE}_gifify_palette.png" | |
if ! $FFMPEG -L > /dev/null 2>&1; then | |
echo "Run: brew install ffmpeg" | |
exit -1 |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"packages_cache": {"https://raw.githubusercontent.com/kairyou/sublime_packages/master/packages.json": [{"homepage": "https://github.com/kairyou/SublimeSimpleSync", "description": "Simple ST2/ST3 plugin for synchronize local and remote files", "releases": [{"sublime_text": "*", "date": "2015-11-16 06:10:02", "platforms": ["*"], "version": "1.0.13", "url": "https://codeload.github.com/kairyou/SublimeSimpleSync/zip/1.0.13"}], "authors": ["tnhu", "gfreezy", "kairyou"], "issues": "https://github.com/kairyou/SublimeSimpleSync/issues", "name": "SublimeSimpleSync", "donate": null, "previous_names": [], "labels": [], "buy": null, "readme": "https://raw.githubusercontent.com/kairyou/SublimeSimpleSync/master/README.md"}, {"homepage": "https://github.com/kairyou/SublimeTmpl", "description": "Create File From Templates for ST2/ST3.", "releases": [{"sublime_text": "*", "date": "2015-06-19 09:53:20", "platforms": ["*"], "version": "1.1.1", "url": "https://codeload.github.com/kairyou/SublimeTmpl/zip/1.1.1"}, {"sublime_text" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Running an activity from terminal using adb is more complex than necessary, | |
you have to find the package and activity names, combine them together | |
and place them in a command that you probably will forget right after | |
using it. | |
We should only give the name of an activity for running one! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import sys | |
from os import listdir | |
from os.path import isfile, join, basename, normpath | |
def usage(): | |
print """ | |
usage: remove_non_translatable <path/to/values-xxx/folder> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reverseProxy = Action.async(parse.raw) { | |
request: Request[RawBuffer] => | |
// Create the request to the upstream server: | |
val proxyRequest = | |
WS.url("http://localhost:8887" + request.path) | |
.withFollowRedirects(false) | |
.withMethod(request.method) | |
.withVirtualHost("localhost:9000") | |
.withHeaders(flattenMultiMap(request.headers.toMap): _*) | |
.withQueryString(request.queryString.mapValues(_.head).toSeq: _*) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// signing.properties | |
STORE_FILE=../app.jks | |
STORE_PASSWORD=**pass** | |
KEY_ALIAS=**key** | |
KEY_PASSWORD=**pass** | |
// app.gradle | |
File propFile = file('signing.properties'); | |
if (propFile.exists()) { |