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 | |
import AVFoundation | |
import CoreML | |
import Vision | |
struct ContentView: View { | |
@ObservedObject var cameraManager = CameraManager() | |
var body: some View { | |
VStack { |
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 | |
import AVFoundation | |
import CoreML | |
import Vision | |
struct ContentView: View { | |
@ObservedObject var cameraManager = CameraManager() | |
var body: some View { | |
VStack { |
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
type Alley = " "; | |
type MazeItem = "🎄" | "🎅" | Alley; | |
type DELICIOUS_COOKIES = "🍪"; | |
type MazeMatrix = MazeItem[][]; | |
type Directions = "up" | "down" | "left" | "right"; | |
type As<From, To> = From extends To? From : never; | |
type Num = 1[] | |
type i<num extends Num> = num['length'] |
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
type Connect4Chips = '🔴' | '🟡'; | |
type Connect4Cell = Connect4Chips | ' '; | |
type Connect4State = '🔴' | '🟡' | '🔴 Won' | '🟡 Won' | 'Draw'; | |
type EmptyBoard = [ | |
[" ", " ", " ", " ", " ", " ", " "], | |
[" ", " ", " ", " ", " ", " ", " "], | |
[" ", " ", " ", " ", " ", " ", " "], | |
[" ", " ", " ", " ", " ", " ", " "], | |
[" ", " ", " ", " ", " ", " ", " "], |
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 'dart:async'; | |
import 'package:bloc/bloc.dart'; | |
import 'package:flutter/widgets.dart'; | |
// interface to close something | |
abstract class AppClosable { | |
void close(); | |
} |
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 'dart:math'; | |
import 'package:cli/cli.dart' as cli; | |
abstract class AbstactBinarySearch { | |
final List<int> nums; | |
final int target; | |
int start = 0; | |
int end; |
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
require 'digest' | |
require 'openssl' | |
require 'base64' | |
require 'net/http' | |
require 'json' | |
require 'time' | |
VWS_ENDPOINT = 'vws.vuforia.com' | |
TARGETS_PATH = '/targets' |
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { Platform, StyleSheet, Text, View, Button } from 'react-native'; |
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 _ = new Proxy({}, {get: (object, prop) => x => Reflect.get(x, prop)}) | |
// Now you can use `_.method` instead of `x => x.method` | |
var a = {someMethod: x => x + 1} | |
_.someMethod(a)(1) // => 2 | |
a.prototype.prototypeMethod = (a, b) => a + b | |
_.prototypeMethod(a)(1, 2) // => 3 |
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
class AnkoViewHolder<out V : AnkoComponent<ViewGroup>>(val parent: ViewGroup, val createUI: () -> V) { | |
class ViewHolder<out V : AnkoComponent<ViewGroup>>(val view: View, val ui: V) : RecyclerView.ViewHolder(view) | |
val ankoContext by lazy { AnkoContext.createReusable(parent.context, parent) } | |
val viewHolder by lazy { | |
val ui = createUI() | |
val view = ui.createView(ankoContext) | |
view.setupTapEffectForBG(true) // default for every item in application | |
// TODO some items may be disabled... | |
ViewHolder(view, ui) |
NewerOlder