A tab completion script that works for Bash. Relies on the BSD md5
command on Mac and md5sum
on Linux, so as long as you have one of those two commands, this should work.
$ gradle [TAB]
# Replace Jekyll's handling of the Redcarpet code_block (which already adds | |
# support for highlighting, but needs support for the very non-standard | |
# "code fences with line highlights" extension). | |
# Since this is currently depending on Redcarpet to cooperate, we are going to | |
# be naive, and only allow line highlighting when a language is specified. If | |
# you don't want any syntax highlighting but want to highlight lines, then you | |
# need to specify text as your language (or it will break), like: | |
# ```text{4} | |
module Jekyll |
/** | |
* This is simple HTTP local server for streaming InputStream to apps which are capable to read data from url. | |
* Random access input stream is optionally supported, depending if file can be opened in this mode. | |
* | |
* from: http://stackoverflow.com/a/9096241 | |
*/ | |
public class StreamOverHttp{ | |
private static final boolean debug = false; | |
private final Browser.FileEntry file; |
/* | |
* Copyright (C) 2006 The Android Open Source Project | |
* | |
* 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 |
/* | |
* Copyright 2014 Johannes Homeier | |
* | |
* 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 |
#import "UILabel+HTML.h" | |
@implementation UILabel (HTML) | |
- (void) setHtml: (NSString*) html | |
{ | |
// Add font from label | |
NSString* finalHtml = [html stringByAppendingString:[NSString stringWithFormat:@"<style>body{font-family: '%@'; font-size:%fpx;}</style>", | |
self.font.fontName, | |
self.font.pointSize]]; |
public static Action1<Throwable> crashOnError() { | |
final Throwable checkpoint = new Throwable(); | |
return throwable -> { | |
StackTraceElement[] stackTrace = checkpoint.getStackTrace(); | |
StackTraceElement element = stackTrace[1]; // First element after `crashOnError()` | |
String msg = String.format("onError() crash from subscribe() in %s.%s(%s:%s)", | |
element.getClassName(), | |
element.getMethodName(), | |
element.getFileName(), | |
element.getLineNumber()); |
/** | |
* Implementation of {@link OnClickListener} that ignores subsequent clicks that happen too quickly after the first one.<br/> | |
* To use this class, implement {@link #onSingleClick(View)} instead of {@link OnClickListener#onClick(View)}. | |
*/ | |
public abstract class OnSingleClickListener implements OnClickListener { | |
private static final String TAG = OnSingleClickListener.class.getSimpleName(); | |
private static final long MIN_DELAY_MS = 500; | |
private long mLastClickTime; |
function onEdit(e) { | |
var range = SpreadsheetApp.getActiveSheet().getDataRange(); | |
for (var j = range.getColumn(); j <= range.getLastColumn(); j++) { | |
for (var i = range.getRow(); i <= range.getLastRow(); i++) { | |
var cell = range.getCell(i, j); | |
var status = cell.getValue(); | |
if (status[0] == '#') { | |
cell.setBackground(status); | |
} else { | |
cell.setBackground('#ffffff'); |
public OkHttpClient getOkClient() { | |
OkHttpClient.Builder builder = new OkHttpClient.Builder(); | |
builder.addInterceptor(new XHttpMethodOverrideInterceptor()); | |
return builder.build() | |
} |