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 StoreKit | |
if #available( iOS 10.3,*){ | |
SKStoreReviewController.requestReview() | |
} |
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
//Shadows | |
view.layer.shadowColor = UIColor.black.cgColor | |
view.layer.shadowOpacity = 0.7 | |
view.layer.shadowOffset = CGSize.zero | |
view.layer.shadowRadius = 5 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> | |
</head> | |
<body> | |
<input class="city" type="text"></input> | |
<button class="submit">Submit</button> |
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
#!flask/bin/python | |
from flask import Flask, jsonify | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return 'Hello from Flask Bob!' | |
men = [ |
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
var request = require('request'); | |
var cheerio = require('cheerio'); | |
request('http://www.factmonster.com/countries.html', function(error, response, html){ | |
if(!error && response.statusCode == 200){ | |
var $ = cheerio.load(html); | |
$('td').each(function(i, element){ | |
// var a = $(this).prev(); | |
var title = $("tr td a").text(); |
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
//DON'T FORGET TO ADD TWO CLASSES: UIIMAGEPICKERCONTROLLERDELEGATE, UINAVIGATIONCONTROLLERDELEGATE | |
//didSelectRowAtIndexPath: allows us to select cell from a tableView | |
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
//indexPath.row : allows us to select cells, in our case we're selecting the first cell | |
if indexPath.row == 0 { | |
//If the photo library is available | |
if UIImagePickerController.isSourceTypeAvailable(.PhotoLibrary) { | |
//instance of the controller, allows us to use it's methods | |
let imagePicker = UIImagePickerController() |
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 { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
var tapGesture = UITapGestureRecognizer(target: self, action: "tap:") | |
self.view.addGestureRecognizer(tapGesture) | |
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 func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [UITableViewRowAction]? { | |
let shareAction = UITableViewRowAction(style: .Default, title: "SHARE") { (action: UITableViewRowAction!, indexPath: NSIndexPath!) -> Void in | |
let shareMenu = UIAlertController(title: nil, message: "Share using one of the below", preferredStyle: .ActionSheet) | |
shareMenu.addAction(UIAlertAction(title: "FaceBook", style: .Default, handler: nil)) | |
shareMenu.addAction(UIAlertAction(title: "Twitter", style: .Default, handler: nil)) | |
shareMenu.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)) | |
self.presentViewController(shareMenu, animated: true, completion: nil) | |
} |
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
//When we select a cell, we want to bring up an alert | |
// We use the didSelectRowAtIndexPath method from UITableViewDelegate | |
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
//CREATE MENU | |
let optionMenu = UIAlertController(title: "Select One", message: "Press one", preferredStyle: .Alert) | |
//MARK: Handler |
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 func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { | |
//create option menu | |
let optionMenu = UIAlertController(title: "Option Menu", message: "Select one", preferredStyle: .ActionSheet) | |
//create action | |
let cancelAction = UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil) | |
//add action to menu |
NewerOlder