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
// CalculatorView.swift | |
// as seen in http://nshipster.com/ibinspectable-ibdesignable/ | |
// | |
// (c) 2015 Nate Cook, licensed under the MIT license | |
import UIKit | |
/// The alignment for drawing an String inside a bounding rectangle. | |
enum NCStringAlignment { | |
case LeftTop |
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 UIKit | |
import Security | |
let serviceIdentifier = "com.company" | |
let accessGroup = "com.company.app" | |
let kSecClassValue = kSecClass as NSString | |
let kSecAttrAccountValue = kSecAttrAccount as NSString | |
let kSecValueDataValue = kSecValueData as NSString | |
let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString |
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
/** | |
* Levenshtein edit distance calculator | |
* Usage: levenstein <string> <string> | |
* | |
* To compile: | |
* sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer | |
* xcrun swift -sdk $(xcrun --show-sdk-path --sdk macosx) levenshtein.swift | |
*/ | |
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
class ViewController: UIViewController { | |
var previewView : UIView!; | |
var blurView: UIVisualEffectView!; | |
//Camera Capture requiered properties | |
var videoDataOutput: AVCaptureVideoDataOutput! | |
var videoDataOutputQueue: DispatchQueue! | |
var previewLayer:AVCaptureVideoPreviewLayer! |
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
/** | |
* Get the human readable size String according to total bytes. | |
*/ | |
func uInt64ToHumanReadable(input: Int64, bBinary: Bool) -> String! { | |
let unit:Int64 = bBinary ? 1024 : 1000; | |
if input < unit { return String(describing: input)+" B"; } | |
let exp:Int = Int(log(Double(input)) / log(Double(unit))); | |
let units: String = (bBinary ? "KMGTPE": "kMGTPE"); | |
let startIndex = units.index(units.startIndex, offsetBy: exp-1); | |
let endIndex = units.index(units.startIndex, offsetBy: exp-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
@Autowired | |
RestTemplate restTemplate; | |
@Bean | |
public RestTemplate restTemplate() { | |
return new RestTemplate(clientHttpRequestFactory()); | |
} | |
private ClientHttpRequestFactory clientHttpRequestFactory() { |
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
driver.manage().window().setSize(new Dimension(1920,1080)); | |
driver.get("http://adultimages.org"); | |
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); | |
// Now you can do whatever you need to do with it, for example copy somewhere | |
FileUtils.copyFile(scrFile, new File("./screenshot.png")); | |
driver.close(); |
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
/** | |
* Check if valid BASE64 String. | |
* @param value | |
* @return | |
*/ | |
public static boolean checkIfValidBase64(String value){ | |
return value.matches("^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$"); | |
} |
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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<configuration> | |
<source>1.6</source> | |
<target>1.6</target> | |
</configuration> | |
</plugin> |
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
# Created by .ignore support plugin (hsz.mobi) | |
### JetBrains template | |
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | |
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | |
## All items under idea folder | |
.idea/ | |
# User-specific stuff: | |
.idea/workspace.xml | |
.idea/tasks.xml | |
.idea/dictionaries |
NewerOlder