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
| double distance_on_geoid(double lat1, double lon1, double lat2, double lon2) { | |
| // Convert degrees to radians | |
| lat1 = lat1 * M_PI / 180.0; | |
| lon1 = lon1 * M_PI / 180.0; | |
| lat2 = lat2 * M_PI / 180.0; | |
| lon2 = lon2 * M_PI / 180.0; | |
| // radius of earth in metres |
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
| //: A UIKit based Playground for presenting user interface | |
| import UIKit | |
| import PlaygroundSupport | |
| class MyViewController : UIViewController { | |
| var touchView = UIView() | |
| var outerCircle = UIView() | |
| var innerCircle = UIView() |
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
| import React, { Component } from "react"; | |
| import { AppRegistry, StyleSheet, Text, Dimensions, View, Animated, TouchableWithoutFeedback } from "react-native"; | |
| export default class animations extends Component { | |
| state = { | |
| played: false, | |
| text: 'Welcome!', | |
| animation: new Animated.Value(50), | |
| a2: new Animated.Value(50), | |
| at: new Animated.Value(0), |
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
| import UIKit | |
| import PlaygroundSupport | |
| class SwiftTacToe { | |
| var spaces = [0, 0, 0, 0, 0, 0, 0, 0, 0 ] | |
| var xTurn = true | |
| var spaceViews : [UIView] = [] | |
| var mainView : UIView | |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta name="description" content="extremely simple pull-streams example"> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> |
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
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const cors = require('cors'); | |
| const logger = require('morgan'); | |
| const multipart = require('connect-multiparty'); | |
| const fs = require('fs'); | |
| const shortid = require('shortid'); | |
| let app = express(); |
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
| import Foundation | |
| typealias NewFileCallback = (fileURL: NSURL) -> Void | |
| class ScreenshotDetector: NSObject, NSMetadataQueryDelegate { | |
| let query = NSMetadataQuery() | |
| var newFileCallback: NewFileCallback? | |
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 f1 = (() => { | |
| var _ref = _asyncToGenerator(function*() { | |
| console.log('start spinner'); | |
| try { | |
| var x = yield resolveAfter2Seconds(10); | |
| console.log('stop spinner'); | |
| console.log(x); // 10 | |
| } catch (e) { | |
| console.log('stop spinner'); | |
| console.log(e); |
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
| //Original | |
| const makeRequest = () => { | |
| return getJSON() | |
| .then(data => { | |
| if (data.needsAnotherRequest) { | |
| return makeAnotherRequest(data) | |
| .then(moreData => { | |
| console.log(moreData) | |
| return moreData | |
| }) |
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
| const makeRequest = () => { | |
| return getJSON() | |
| .then(data => { | |
| if (data.needsAnotherRequest) { | |
| return makeAnotherRequest(data) | |
| .then(moreData => { | |
| console.log(moreData) | |
| return moreData | |
| }) | |
| } else { |