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 SwiftUI | |
struct PhotoView: View { | |
@State var scale: CGFloat = 1 | |
@State var scaleAnchor: UnitPoint = .center | |
@State var lastScale: CGFloat = 1 | |
@State var offset: CGSize = .zero | |
@State var lastOffset: CGSize = .zero | |
@State var debug = "" |
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 json | |
import datetime | |
import decimal | |
import boto3 | |
from boto3.dynamodb.conditions import Key, Attr | |
print('Loading function') | |
dynamodb = boto3.resource('dynamodb') | |
def lambda_handler(event, context): |
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
fds |
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
# npm node.js install | |
RUN apt-get -y update | |
RUN apt-get install -y \ | |
curl \ | |
gnupg | |
RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - | |
RUN apt-get install -y nodejs | |
RUN npm install npm@latest -g |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?php | |
phpinfo(); | |
?> |
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 AVFoundation | |
import UIKit | |
class ViewController: UIViewController { | |
var audioPlayer = AVAudioPlayer() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
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
addressEdit = (EditText)findViewById(R.id.address); | |
final EditText addressEdit = (EditText)findViewById(R.id.address); | |
new Thread(){ | |
@Override | |
public void run(){ | |
final String address = MyLib.getAddress(location, getApplicationContext()); | |
new Handler(Looper.getMainLooper()).post(new Runnable(){ | |
@Override |
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
Intent i = new Intent(); | |
i.setClassName("sensor.sports.co.jp.notification", "sensor.sports.co.jp.notification.MainActivity"); | |
PendingIntent pi = PendingIntent.getActivity(this, 0, i, 0); | |
Notification notification = new NotificationCompat.Builder(this) | |
.setContentTitle("タイトル") | |
.setContentText("現在、走行距離を測定してます。") | |
.setSmallIcon(R.drawable.notification_template_icon_bg) | |
.setContentIntent(pi) | |
.build(); |
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
public double getDistance(LatLng latlng1, LatLng latlng2) { | |
float[] results = new float[3]; | |
Location.distanceBetween( | |
latlng1.latitude, | |
latlng1.longitude, | |
latlng2.latitude, | |
latlng2.longitude, | |
results); | |
if(results != null && results.length > 0) { |
NewerOlder