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
class RangedInputFilter implements InputFilter { | |
private int fieldSize; | |
private int min, max; | |
RangedInputFilter(int fieldSize, int min, int max) { | |
this.fieldSize = fieldSize; | |
if (min > max) { | |
throw new IllegalArgumentException("Min value should be less or equal to max"); |
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/python | |
import json | |
import re | |
import sys | |
#TODO use raw strings | |
DALVIK_VM_LINE = re.compile("^.*/dalvikvm\(\s*(\d+)\)\s*:\s*(.*)$") | |
DALVIK_HEAP_GROW_LINE = re.compile("^.*/dalvikvm-heap\(\s*(\d+)\).*Grow\sheap.*$") | |
class GCStats: |
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
# Set background | |
bg = new BackgroundLayer backgroundColor: "#f5f5f5" | |
bg.sendToBack() | |
# Variables | |
favIn = true | |
checkIn = true | |
collapsed = true | |
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 | |
import sys | |
import tweepy | |
import urllib2 | |
CONSUMER_KEY = "<your consumer key>" | |
CONSUMER_SECRET = "<your consumer secret>" | |
ACCESS_TOKEN = "<your access token>" | |
ACCESS_TOKEN_SECRET = "<your access secret>" |
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 xcrun swift -i | |
//No, it doesn't compile | |
//Hello World | |
println("Hello Worl") | |
//Variables | |
var aInt: Int = 1 |
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
// | |
// REST.swift | |
// CoconutTests | |
// | |
// Created by Andre Oriani on 2/5/16. | |
// Copyright © 2016 Walmartlabs. All rights reserved. | |
// | |
import Foundation |
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
// | |
// ViewController.swift | |
// BarcodeReader | |
// | |
// Created by Andre Oriani on 2/28/16. | |
// Copyright © 2016 Orion. All rights reserved. | |
// | |
import UIKit | |
import AVFoundation |
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
for a in * | |
do | |
date=$(exiftool -s -s -s -DateTimeOriginal ${a} |cut -d":" -f1,2,3,4 | tr -d ":" | tr -d " ") | |
touch -mt ${date} ${a} | |
touch -t ${date} ${a} | |
done |
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
// | |
// ViewController.swift | |
// Animations | |
// | |
// Created by Andre Oriani on 1/16/17. | |
// Copyright © 2017 Orion. All rights reserved. | |
// | |
import UIKit |
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
@SuppressLint("NewApi") | |
@BindingAdapter("android:tint") | |
public static void setTintCompat(ImageView imageView, @ColorInt int color) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
imageView.setImageTintList(android.databinding.adapters.Converters.convertColorToColorStateList(color)); | |
} else { | |
final Drawable originalDrawable = imageView.getDrawable(); | |
if (originalDrawable instanceof VectorDrawableCompat) { | |
VectorDrawableCompat vectorDrawableCompat = (VectorDrawableCompat) originalDrawable; | |
vectorDrawableCompat.setTint(color); |
OlderNewer