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 | |
final class SizeClassNotifier: ObservableObject { | |
@Published var currentSizeClass: UserInterfaceSizeClass = | |
.compact | |
func updateSizeClass(sizeClass: UserInterfaceSizeClass?) { | |
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { | |
self.currentSizeClass = sizeClass ?? .compact |
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 UIKit | |
import PlaygroundSupport | |
import SwiftUI | |
struct ContentView: View { | |
var jumpAmount: CGFloat { | |
CGFloat(-time * time + time) | |
} | |
var scaleX: CGFloat { 1/scaleY } |
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 ARKit | |
// Example usage: | |
// let twentyCentimeters: Float = 20.cm | |
// let twoMeters: Float = 2.m | |
// let oneMillimeter: Float = 1.mm | |
// let extent: float3 = float3(20.cm, 10.cm, 1.m) | |
extension Int { | |
var mm: Float { |
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
var _ = require('underscore') | |
var lines = [ | |
"#The test", | |
"###Hello World", | |
"This is a new paragraph.", | |
"It has a second line", | |
"", | |
"This is my new paragraph" | |
]; |
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
<html> | |
<head> | |
<script type="text/preloaded">{"preloaded":true}</script> | |
</head> | |
<body> | |
<div ng-app="appModule"></div> | |
</body> | |
</html> |
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
angular.module('appModule') | |
//app initialization | |
.constant('MY_CONFIG', {}) | |
.config(['MY_CONFIG', function(MY_CONFIG){ | |
var scripts = document.getElementsByTagName('script'); | |
for (var i = 0; i < scripts.length; i++) { | |
var script = scripts[i]; | |
if(script.type === 'text/preloaded'){ | |
var data = JSON.parse(script.innerHTML); | |
angular.extend(MY_CONFIG, data); |
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)setupShadowForView:(UIView *)view { | |
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:view.frame cornerRadius:10]; | |
CALayer *viewLayer = view.layer; | |
[viewLayer setShadowColor:[UIColor blackColor].CGColor]; | |
[viewLayer setShadowOpacity:1.0f]; | |
[viewLayer setShadowRadius:10.0f]; | |
[viewLayer setShadowPath:[path CGPath]]; | |
} |
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
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
int timesOpened = [defaults integerForKey:@"timesOpened"]; | |
NSLog(@"App has been opened %d times", timesOpened); | |
if(timesOpened >= 4){ | |
[RFRateMe showRateAlert]; | |
} | |
[defaults setInteger:(timesOpened+1) forKey:@"timesOpened"]; | |
[defaults synchronize]; |
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
CXX= g++ | |
CXXFILES= pysmilebridge.cpp | |
CXXINTERMEDIATE= pysmilebridge.o | |
CXXOUTPUTLIBS= libpysmilebridge.so | |
CXXFLAGS= -O3 -DNDEBUG -ffast-math -Wall -fPIC | |
LIBS = -L/path/to/smile/ -lsmile | |
all: lib | |
lib: |
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 <UIKit/UIKit.h> | |
#import "WebViewController.h" | |
@interface ViewController : WebViewController | |
@end |
NewerOlder