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
/* | |
This will take a .save game file, decode it into its JSON form, | |
and then save it to game-data.json | |
*/ | |
const fs = require('fs'); | |
const LZString = require('lz-string'); | |
if (process.argv.length === 3) { | |
try { | |
const encodedData = fs.readFileSync(process.argv[2], 'utf8'); |
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
--- | |
eleventyExcludeFromCollections: true | |
eleventyComputed: | |
permalink: "{{ site.robots }}" | |
--- | |
Sitemap: {{ site.baseUrl + site.siteMap }} | |
User-agent: * | |
Disallow: |
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 time | |
from transformers import pipeline, Conversation | |
model_name = "facebook/blenderbot-400M-distill" | |
start = time.time() | |
converse = pipeline("conversational", model=model_name) | |
print(f"Model loaded. Time taken: {time.time() - start} seconds") | |
conversation = Conversation() |
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
<!-- | |
This code displays the dropdown for the options to sort from. | |
Adapted from https://gist.github.com/carolineschnapp/11352987 | |
It will be inserted on every collections page. Probably in a snippet called something like collection-sorting.liquid | |
--> | |
<div class="form-horizontal"> | |
<label for="SortBy" class="uppercase">{{ 'collections.sorting.title' | t }} </label> | |
<select name="SortBy" id="SortBy"> |
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 request = require('request'); | |
const GOOGLE_API_KEY = 'your api key'; // from https://console.developers.google.com/apis/credentials | |
const urlToShorten = 'http://www.thelongurltoshorten.com'; | |
const shortenerUrl = `https://www.googleapis.com/urlshortener/v1/url?key=${GOOGLE_API_KEY}`; | |
const options = { | |
uri: shortenerUrl, | |
json: { | |
longUrl: urlToShorten |
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 axios from 'axios'; | |
const playAudio = async ({ text, voiceId }) => { | |
const response = await axios.post( | |
`https://api.elevenlabs.io/v1/text-to-speech/${voiceId}`, | |
{ text }, | |
{ | |
headers: { | |
'Content-Type': 'application/json', | |
'xi-api-key': process.env.REACT_APP_ELEVENLABS_API_KEY |
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 { useState } from 'react'; | |
import { TextInput } from 'react-native-paper'; | |
const PasswordInput = ({ password, setPassword }) => { | |
const [showPassword, setShowPassword] = useState(false); | |
return ( | |
<TextInput | |
label="Password" | |
secureTextEntry={!showPassword} |
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 { View } from 'react-native'; | |
import { | |
cacheDirectory, | |
writeAsStringAsync, | |
EncodingType | |
} from 'expo-file-system'; | |
import { Audio } from 'expo-av'; | |
import { Button } from 'react-native-paper'; | |
import base64AudioEncodedString from './assets/sounds'; |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Currency Conversion</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" | |
crossorigin="anonymous"> |
NewerOlder