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> | |
<title>COMP484</title> | |
</head> | |
<body> | |
<form action="" method="post" id="theForm"> | |
<fieldset> | |
<p>Use this form to calculate the sum.</p> | |
<div><label for="input1">Input Number</label> |
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
# first: mkdir user && cd user && cp /path/to/get_gists.py . | |
# python3 get_gists.py user | |
import requests | |
import sys | |
from subprocess import call | |
user = sys.argv[1] | |
r = requests.get('https://api.github.com/users/{0}/gists'.format(user)) |
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
// | |
// ContactsManager.swift | |
// main | |
// | |
// Created by Nero Wolfe on 14/07/16. | |
// Copyright © 2016 Incoding. All rights reserved. | |
// | |
import UIKit | |
import Contacts |
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
func addUserToAddressBook(contact: User){ | |
let stat = ABAddressBookGetAuthorizationStatus() | |
switch stat { | |
case .Denied, .Restricted: | |
println("no access to addressbook") | |
case .Authorized, .NotDetermined: | |
var err : Unmanaged<CFError>? = nil | |
var adbk : ABAddressBook? = ABAddressBookCreateWithOptions(nil, &err).takeRetainedValue() | |
if adbk == nil { | |
println(err) |
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
/** | |
* Sample of upload file to Google Cloud Stoage. | |
* | |
* 1. Setup a bucket and grant write permission for All Users on Google Cloud Stoage. | |
* | |
* 2. Install dependency 'request' | |
* | |
* 3. Set 'filename' and 'bucket' | |
* | |
* 4. Run!! |