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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.8.4; | |
contract HelloWorld { | |
uint256 number; | |
/** | |
* @dev Store a number in a variable |
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
// From https://github.com/xavidop/alexa-typescript-lambda-helloworld/blob/master/lambda/custom/src/utilities/strings.ts | |
import { Strings, LocaleTypes } from './constants'; | |
interface IStrings { | |
[Strings.SKILL_NAME]: string; | |
[Strings.WELCOME_MSG]: string; | |
[Strings.GOODBYE_MSG]: string; | |
[Strings.HELLO_MSG]: string; | |
[Strings.HELP_MSG]: string; | |
[Strings.ERROR_MSG]: 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 { HandlerInput, getRequestType, getIntentName } from 'ask-sdk-core'; | |
export function isType(handlerInput: HandlerInput, ...types: string[]): boolean { | |
return types.some((type) => type === getRequestType(handlerInput.requestEnvelope)); | |
} | |
export function isIntent(handlerInput: HandlerInput, ...intents: string[]): boolean { | |
if (isType(handlerInput, 'IntentRequest')) { | |
return intents.some((name) => name === getIntentName(handlerInput.requestEnvelope)); | |
} |
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 { HandlerInput, getRequestType, getIntentName } from 'ask-sdk-core'; | |
const PlayStreamRequestTypes = ['LaunchRequest', 'IntentRequest']; | |
const PlayStreamRequestIntentNames = [ | |
'PlayStreamIntent', | |
'AMAZON.ResumeIntent', | |
'AMAZON.LoopOnIntent', | |
'AMAZON.NextIntent', | |
'AMAZON.PreviousIntent', | |
'AMAZON.RepeatIntent', |
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
canHandle(handlerInput: HandlerInput) { | |
return handlerInput.requestEnvelope.request.type === 'LaunchRequest' | |
|| (handlerInput.requestEnvelope.request.type === 'IntentRequest' | |
&& ( | |
handlerInput.requestEnvelope.request.intent.name === 'PlayStreamIntent' | |
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.ResumeIntent' | |
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.LoopOnIntent' | |
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.NextIntent' | |
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.PreviousIntent' | |
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.RepeatIntent' |
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
// Taken from: https://github.com/Markkop/corvo-astral/commit/6455dfe7d2fd0258a2e45703cbdad7f4c8fab12c | |
import Discord from 'discord.js' | |
import { getAlmanaxBonus } from './helpers' | |
const client = new Discord.Client() | |
const prefix = '.' | |
client.on('message', function (message) { | |
if (message.author.bot) return |
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
** | |
* @typedef AlmanaxEvent | |
* @property { String } firstDate | |
* @property { String } name | |
* @property { String } text | |
*/ | |
/** | |
* Calculate today's Almanax Bonus | |
* @returns { AlmanaxEvent } |
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
// Taken from https://github.com/Markkop/corvo-astral/blob/ea51ce51d0/src/importers/sublimations/getSublimationsEffects.js | |
import { saveFile, openFile } from '../../utils/files' | |
import axios from 'axios' | |
/** | |
* Execute this script. | |
*/ | |
export async function getSublimationsEffects () { | |
const sublimations = openFile('data/raw/sublimations/sublimations.json') |
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
// Taken from https://github.com/Markkop/corvo-astral/blob/ea51ce51d0/tests/testUtils.js | |
import config from '../src/config' | |
const { defaultConfig: { partyChannel } } = config | |
/** | |
* Mocks a channel message to match properties from a Discord Message. | |
* Note that channel messages has actually Collection type and here we're treating them | |
* as arrays and enriching their properties to have the same as a Discord Collection. | |
* |
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 '../styles/globals.css' | |
import NavBar from '../components/NavBar' | |
import Head from 'next/head' | |
function MyApp ({ Component, pageProps }) { | |
return ( | |
<> | |
<Head> | |
<title>Tarrafa Hackerclub</title> | |
<link rel="icon" href="/favicon.ico" /> |