This file contains hidden or 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 pandas as pd | |
| from sklearn.feature_extraction.text import TfidfVectorizer | |
| from sklearn.metrics.pairwise import cosine_similarity | |
| # Load CSV | |
| df = pd.read_csv("submissions.csv") | |
| # Use the 'rationale' column | |
| rationales = df['rationale'].fillna('') |
This file contains hidden or 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 { promises as fs } from "node:fs"; | |
| import { pdf } from "pdf-to-img"; | |
| import path from "path"; | |
| import { fileURLToPath } from "url"; | |
| import sharp from "sharp"; | |
| import Ocr from "@gutenye/ocr-node"; | |
| // Handle ES module paths | |
| const __filename = fileURLToPath(import.meta.url); | |
| const __dirname = path.dirname(__filename); |
This file contains hidden or 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 | |
| from ftfy import fix_text | |
| def fix_obj(o): | |
| if isinstance(o, str): | |
| return fix_text(o) | |
| if isinstance(o, list): | |
| return [fix_obj(x) for x in o] | |
| if isinstance(o, dict): | |
| return {k: fix_obj(v) for k,v in o.items()} |
This file contains hidden or 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 fs = require("fs"); | |
| const xlsx = require("xlsx"); | |
| async function xlsxToJson(inputFile, outputFile) { | |
| return new Promise((resolve, reject) => { | |
| try { | |
| console.log(`Converting ${inputFile} to JSON...`); | |
| if (!fs.existsSync(inputFile)) { | |
| return reject(new Error(`Input file ${inputFile} does not exist`)); |
This file contains hidden or 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 fs = require("fs"); | |
| const { parse } = require("csv-parse"); | |
| async function csvToJson(inputFile, outputFile) { | |
| return new Promise((resolve, reject) => { | |
| console.log(`Converting ${inputFile} to JSON...`); | |
| if (!fs.existsSync(inputFile)) { | |
| return reject(new Error(`Input file ${inputFile} does not exist`)); | |
| } |
This file contains hidden or 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 fs from "fs"; | |
| import path from "path"; | |
| import { spawnSync } from "child_process"; | |
| /* ================= ENV ================= */ | |
| const BB_WORKSPACE = ""; | |
| const BB_TOKEN = ""; | |
| const BB_USERNAME = ""; | |
| const BB_EMAIL = ""; | |
| const GH_ORG = ""; |
This file contains hidden or 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 {useState, useEffect, useRef, useCallback} from 'react'; | |
| import {View,Text,BackHandler, Share as RNshare, Platform} from 'react-native'; | |
| import {WebView} from 'react-native-webview'; | |
| import {useRoute, useNavigation} from '@react-navigation/native'; | |
| import {useFocusEffect, useIsFocused} from '@react-navigation/native'; | |
| import Share from 'react-native-share'; | |
| import ReactNativeBlobUtil from 'react-native-blob-util'; | |
| import styled from 'styled-components/native'; | |
| import axios from 'axios'; | |
| import HeaderComponentWithBackButton from '../components/HeaderComponentWithBackButton'; |
This file contains hidden or 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, {useRef} from 'react'; | |
| import {PanResponder} from 'react-native'; | |
| import {GestureHandlerRootView} from 'react-native-gesture-handler'; | |
| export default GestureHandlerContainer = ({onRightSwipe = () =>{}, onLeftSwipe = () =>{},onUpSwipe = () =>{},onDownSwipe = () =>{},children}) => { | |
| const panResponder = useRef( | |
| PanResponder.create({ | |
| onStartShouldSetPanResponder: () => true, |
This file contains hidden or 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 {create} from 'zustand'; | |
| import {persist} from 'zustand/middleware'; | |
| import {createJSONStorage} from 'zustand/middleware'; | |
| import {MMKV} from 'react-native-mmkv'; | |
| const storage = new MMKV(); | |
| const zustandStorage = { | |
| setItem: (name, value) => { | |
| return storage.set(name, value); |
NewerOlder