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 PIL.Image | |
import numpy as np | |
def image_to_ascii(image_path, output_path, ascii_char='#', width=100): | |
""" | |
Convert a black and white image to ASCII art using a single character | |
Args: | |
image_path: Path to the input image | |
output_path: Path to save the ASCII art as text file |
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, { FC, useEffect } from "react" | |
import { observer } from "mobx-react-lite" | |
import { TextStyle, View, ViewStyle } from "react-native" | |
import { AppStackScreenProps } from "app/navigators" | |
import { ListView, Screen, Text } from "app/components" | |
import { colors, spacing } from "app/theme" | |
import { Question, useStores } from "app/models" | |
import { decodeHTMLEntities } from "app/utils/decodeHtml" | |
import { ContentStyle } from "@shopify/flash-list" |
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 { RadioGroup } from "react-native-radio-buttons-group" | |
... | |
export const QuestionScreen: FC<QuestionScreenProps> = observer(function QuestionScreen() { | |
... | |
const onPressAnswer = (question: Question, guess: string) => { | |
question.setGuess(guess) | |
} |
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 shuffle from "lodash.shuffle" | |
export const QuestionModel = types | |
.model("Question") | |
.props({ | |
id: types.identifier, | |
category: types.maybe(types.string), | |
type: types.enumeration(["multiple", "boolean"]), | |
difficulty: types.enumeration(["easy", "medium", "hard"]), | |
question: types.maybe(types.string), |
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 shuffle from "lodash.shuffle" | |
... | |
... | |
export const QuestionModel = types | |
... | |
.views((self) => ({ | |
get allAnswers() { | |
return shuffle([ | |
...self.incorrectAnswers, |
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, { FC } from "react" | |
import { observer } from "mobx-react-lite" | |
import { TextStyle, View, ViewStyle } from "react-native" | |
import { AppStackScreenProps } from "app/navigators" | |
import { Screen, Text } from "app/components" | |
import { spacing } from "app/theme" | |
// import { useNavigation } from "@react-navigation/native" | |
// import { useStores } from "app/models" | |
interface QuestionScreenProps extends AppStackScreenProps<"Question"> {} |
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
const entities = { | |
amp: "&", | |
apos: "'", | |
lt: "<", | |
gt: ">", | |
quot: '"', | |
nbsp: "\xa0", | |
ouml: "ö", | |
auml: "ä", | |
uuml: "ü", |
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 strict'; | |
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
LayoutAnimation, | |
} 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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
// 1. init window | |
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
UIViewController *rootViewController = [UIViewController new]; | |
// 2. backgroundView using LaunchScreen.xib | |
UIView *backgroundView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] firstObject]; | |
backgroundView.frame = self.window.bounds; | |
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
// | |
// RCTAccessibilityManager+FontMultipliers.m | |
// | |
// This category is a workaround React Native's default Font Sizing Accessibility settings | |
// | |
// Swizzle the getter of the font size multipliers so we can limit the max size. | |
// | |
#import "RCTAccessibilityManager+FontMultipliers.h" | |
#import <objc/runtime.h> |
NewerOlder