This file contains 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 | |
from http.server import SimpleHTTPRequestHandler | |
from socketserver import TCPServer | |
import logging | |
PORT = 8000 | |
class GetHandler(SimpleHTTPRequestHandler): |
This file contains 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
... | |
@Override | |
public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) { | |
super.setPrimaryItem(container, position, object); | |
NestedScrollView current = ((NestedScrollView)object); | |
current.setNestedScrollingEnabled(true); | |
for (int i = 0; i < getCount(); i++) { | |
if (i != position) { | |
NestedScrollView otherScrollView = container.findViewWithTag(i); |
This file contains 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
# dependencies: | |
# - ffmpeg | |
# - imagemagick | |
# Usage: | |
mkdir mp4_to_gif | |
ffmpeg -i myfile.mp4 -vf scale=1024:-1:flags=lanczos,fps=10 mp4_to_gif/ffout%03d.png | |
convert -loop 0 mp4_to_gif/ffout*.png output.gif | |
rm -rf mp4_to_gif |
This file contains 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 main | |
import "fmt" | |
func main() { | |
s := []int{2, 3, 5, 7, 11, 13} | |
printSlice(s) | |
removeFirst(s) | |
printSlice(s) |
This file contains 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 org.mockito.configuration; | |
import org.mockito.internal.stubbing.defaultanswers.ReturnsEmptyValues; | |
import org.mockito.invocation.InvocationOnMock; | |
import org.mockito.stubbing.Answer; | |
import rx.Observable; | |
import rx.Single; | |
/** |
This file contains 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
if [ "${CONFIGURATION}" == "Release" ]; then | |
cp -r "${PROJECT_DIR}/{PATH}/GoogleService-Info-release.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
echo "Production plist copied" | |
elif [ "${CONFIGURATION}" == "Debug" ]; then | |
cp -r "${PROJECT_DIR}/{PATH}/GoogleService-Info-debug.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" | |
echo "Development plist copied" |
This file contains 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
<activity ..> | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="http" /> | |
<data android:scheme="https" /> | |
<data android:host="www.mysite.com" /> | |
</intent-filter> | |
</activity> |
This file has been truncated, but you can view the full file.
This file contains 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
travis_fold:start:worker_info | |
[0K[33;1mWorker information[0m | |
hostname: travis-worker-gce-com-prod2-1:94376007-71e0-467f-98cb-8122cf852888 | |
version: v2.5.0 https://github.com/travis-ci/worker/tree/da3a43228dffc0fcca5a46569ca786b22991979f | |
instance: testing-gce-37d82fd8-fa7e-47d8-9278-88a7e48f39cb:travis-ci-android-precise-1478744927 | |
startup: 21.129647774s | |
travis_fold:end:worker_info | |
[0Ktravis_fold:start:system_info | |
[0K[33;1mBuild system information[0m | |
Build language: android |
This file contains 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
... | |
- (BOOL)application:(UIApplication *)application | |
openURL:(NSURL *)url | |
sourceApplication:(NSString *)sourceApplication | |
annotation:(id)annotation | |
{ | |
// imnotyourson://article/123, imnotyourson://user/123 | |
if ([url.scheme isEqualToString:@"imnotyourson"]) { | |
NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { | |
dispatch_async(dispatch_get_main_queue(), ^{ |
This file contains 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
#import "ImnotyoursonURLProtocol.h" | |
#import "User.h" | |
#import "Article.h" | |
#import "GenericItem.h" | |
@implementation ImnotyoursonURLProtocol | |
+ (BOOL)canInitWithRequest:(NSURLRequest *)request | |
{ |