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 Foundation | |
import XCPlayground | |
// Let asynchronous code run | |
XCPSetExecutionShouldContinueIndefinitely() | |
let url = NSURL(string: "http://www.reddit.com/.json") | |
let session = NSURLSession.sharedSession() | |
let task = session.dataTaskWithURL(url!, completionHandler: { |
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
1. Navigate to the “Info” Panel in your app target. | |
2. Add a new key titled “NSAppTransportSecurity” with type Dictionary | |
3. Add a new key under the one you just created with the name “NSAllowsArbitraryLoads” with type Boolean and value YES | |
Source: | |
http://www.looneydoodle.com/2015/07/ios9-app-transport-security-policy/ |
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
// | |
// DataTableViewController.swift | |
// tableView | |
// | |
// Created by Cuong Tran on 9/16/15. | |
// Copyright © 2015 Cuong Tran. 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
let indicator:UIActivityIndicatorView = UIActivityIndicatorView (activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray) | |
indicator.color = UIColor.blackColor() | |
indicator.frame = CGRectMake(0.0, 0.0, 10.0, 10.0) | |
indicator.center = self.view.center | |
self.view.addSubview(indicator) | |
indicator.bringSubviewToFront(self.view) | |
indicator.startAnimating() |
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
!function(){d3.hexbin=function(){function u(n){var r={};return n.forEach(function(n,t){var a=s.call(u,n,t)/o,e=Math.round(a),c=h.call(u,n,t)/i-(1&e?.5:0),f=Math.round(c),l=a-e;if(3*Math.abs(l)>1){var v=c-f,g=f+(f>c?-1:1)/2,m=e+(e>a?-1:1),M=c-g,d=a-m;v*v+l*l>M*M+d*d&&(f=g+(1&e?1:-1)/2,e=m)}var j=f+"-"+e,p=r[j];p?p.push(n):(p=r[j]=[n],p.i=f,p.j=e,p.x=(f+(1&e?.5:0))*i,p.y=e*o)}),d3.values(r)}function a(r){var t=0,u=0;return n.map(function(n){var a=Math.sin(n)*r,e=-Math.cos(n)*r,i=a-t,o=e-u;return t=a,u=e,[i,o]})}var e,i,o,c=1,f=1,h=r,s=t;return u.x=function(n){return arguments.length?(h=n,u):h},u.y=function(n){return arguments.length?(s=n,u):s},u.hexagon=function(n){return arguments.length<1&&(n=e),"m"+a(n).join("l")+"z"},u.centers=function(){for(var n=[],r=0,t=!1,u=0;f+e>r;r+=o,t=!t,++u)for(var a=t?i/2:0,h=0;c+i/2>a;a+=i,++h){var s=[a,r];s.i=h,s.j=u,n.push(s)}return n},u.mesh=function(){var n=a(e).slice(0,4).join("l");return u.centers().map(function(r){return"M"+r+"m"+n}).join("")},u.size=function(n){return arg |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>D3 Multi-bar graph</title> | |
<style> | |
#vis { | |
padding: 20px; | |
} |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>D3 Multi-lines Graph</title> | |
<style> | |
#vis > svg { | |
overflow: visible; | |
} | |
</style> |
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
(function () { | |
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers | |
var d3_style_prototype = this.CSSStyleDeclaration.prototype, | |
d3_style_setProperty = d3_style_prototype.setProperty; | |
d3_style_prototype.setProperty = function (name, value, priority) { | |
try { | |
d3_style_setProperty.call(this, name, value + '', priority); | |
} catch (exception) { | |
// console.warn('d3_style_prototype.setProperty - name: ', name, ', value: ', value, ', priority: ', priority, ', exception: ', exception); |
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
{"lastUpload":"2019-09-09T19:05:14.128Z","extensionVersion":"v3.4.2"} |