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>Letters To Bitcoin</title> | |
<style> | |
body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; |
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 { Address, Bn, KeyPair, PrivKey, TxOut } from "@ts-bitcoin/core"; | |
import { UTXO } from "./lib/models"; | |
import { createOrderLockTx } from "./lib/create-ordinal-lock"; | |
import { cancelOrderLockTx } from "./lib/cancel-ordinal-lock"; | |
import { purchaseOrderLockTx } from "./lib/purchase-ordinal-lock"; | |
const { SELLER_PAYMENT_WIF, SELLER_ORDINAL_WIF, BUYER_PAYMENT_WIF, BUYER_ORDINAL_WIF } = process.env; | |
// Seller's UTXO representing an ordinal token to sell | |
let sellerOrdinalUtxo: UTXO = { |
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 React, { useEffect, useState, Suspense } from 'react'; | |
import FileType from 'file-type/browser'; | |
import { Canvas } from '@react-three/fiber'; | |
import { OrbitControls, Loader, useGLTF } from '@react-three/drei'; | |
const Model = ({ url }) => { | |
const { scene } = useGLTF(url); | |
return <primitive object={scene} dispose={null} />; | |
}; |
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>BAPPY BIRD</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
#game-container { | |
position: relative; | |
width: 480px; |
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
- (IBAction)cameraBarButtonItemPressed:(UIBarButtonItem *)sender { | |
UIImagePickerController *picker = [[UIImagePickerController alloc] init]; | |
picker.delegate = self; | |
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]){ | |
picker.sourceType = UIImagePickerControllerSourceTypeCamera; | |
}else if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum]){ | |
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum; | |
} | |
[self presentViewController:picker 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
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Album"]; | |
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"date" ascending:YES]]; | |
id delegate = [[UIApplication sharedApplication] delegate]; | |
NSManagedObjectContext *moc = [delegate managedObjectContext]; | |
NSError *error = nil; | |
NSArray *fetchedAlbums = [moc executeFetchRequest:fetchRequest error:&error]; | |
self.albums = [fetchedAlbums mutableCopy]; |
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
@interface ViewController () | |
@property (weak, nonatomic) IBOutlet UIView *pathView; | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:)]; |
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
- (void)setTargetAction{ | |
UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; | |
myButton.frame = CGRectMake(40, 40, 200, 10); | |
[myButton setTitle:@"Click Me" forState:UIControlStateNormal]; | |
[myButton addTarget:self action:@selector(didPressButton) forControlEvents:UIControlEventTouchUpInside]; | |
} | |
-(IBAction)didPressButton:(UIButton *) sender{ | |
//button got clicked |
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
-(NSDate *) workWithDate | |
{ | |
NSDate *date = [NSDate date]; | |
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | |
[formatter setDateFormat:@"yyyy-MM-dd"]; | |
NSString *dateAsString = [formatter stringFromDate:date]; | |
NSLog(@"Date as String: %@", dateAsString); | |
NSLog(@"Date from Date: %@", date); |
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
//Retrieve the App Delegate | |
let appDelegate = UIApplication.sharedApplication().delegate as AppDelegate | |
// Show Alert | |
var alertController = UIAlertController(title: "Alert", message: "Your device does not support the camera or photo library", preferredStyle: UIAlertControllerStyle.Alert) | |
alertController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: nil)) | |
self.presentViewController(alertController, animated: true, completion: nil) | |