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
mkdir tests | |
echo " | |
describe(\"A suite\", function() { | |
it(\"contains spec with an expectation\", function() { | |
expect(true).toBe(true); | |
}); | |
}); | |
" > tests/test.spec.js | |
npm install karma --save-dev |
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
let params: Dictionary<String,AnyObject> = ["user[country_name]": countryName, "user[country_code]": countryCode, "user[mobile_number]": mobileNumber, "user[name]":"", "user[device_token]":deviceToken] | |
Alamofire.request(.POST, ConstantsBackend.URL_REGISTER, parameters: params) | |
.validate(statusCode: 200..<300) | |
.validate(contentType: ["application/json"]) | |
.responseJSON { (_, _, JSON, ERROR) in | |
if (ERROR != nil) | |
{ | |
println("FALHA AO REGISTRAR") | |
LoadingOverlay.shared.hideOverlayView() |
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
let _storyboard = UIStoryboard(name: "Main", bundle: nil) | |
let vc = _storyboard.instantiateViewControllerWithIdentifier("countryTableViewController") as CountryTableViewController | |
vc.setupDelegate = self | |
self.showViewController(vc, sender: nil) |
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
let alertController = UIAlertController(title: "Atenção...", message: "Código de funcionário inválido!", preferredStyle: UIAlertControllerStyle.Alert) | |
alertController.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil)) | |
self.presentViewController(alertController, animated: true, completion: nil) |
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
// | |
// AppDelegate.swift | |
// app | |
// | |
// Created by Igor de Oliveira Sa on 25/02/15. | |
// Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved. | |
// | |
import UIKit | |
import CoreData |
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
// | |
// LoadingOverlay.swift | |
// app | |
// | |
// Created by Igor de Oliveira Sa on 25/03/15. | |
// Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved. | |
// | |
// Usage: | |
// | |
// # Show Overlay |
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
public class CharlieFTPClient { | |
FTPClient ftpClient; | |
public CharlieFTPClient(FTPClient ftpClient) { | |
this.ftpClient = ftpClient; | |
} | |
public boolean connect(String ip, String userName, String pass) throws IOException { | |
ftpClient.setConnectTimeout(10 * 1000); | |
ftpClient.connect(InetAddress.getByName(ip)); |
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
AlertDialog.Builder alert = new AlertDialog.Builder(context); | |
alert.setTitle("Title"); | |
alert.setMessage("Message"); | |
// Set an EditText view to get user input | |
final EditText input = new EditText(context); | |
alert.setView(input); | |
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener() { |
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
ImageView imageView = new ImageView(context); | |
LinearLayout.LayoutParams imageViewLayoutParams = new LinearLayout.LayoutParams(56,56); | |
imageViewLayoutParams.setMargins(context.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin), 0, 0, 0); | |
imageView.setLayoutParams(imageViewLayoutParams); | |
imageView.setTag(photo); |
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
LinearLayout linearLayout = new LinearLayout(context); | |
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT); | |
layoutParams.setMargins(context.getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin),0,0,0); | |
linearLayout.setLayoutParams(layoutParams); | |
linearLayout.setBackground(context.getResources().getDrawable(R.drawable.shape_rounded_background)); |
NewerOlder