The difference between local and play environment is strictNullChecks
. It's set to false by default locally, but is enabled on the playground by default.
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
// purchase a product with a credit card | |
purchase('productId') | |
.using( { | |
cc: "4556934156210213", | |
valid: "2016-10", | |
csc: "123" | |
} ) | |
// purchase a product with paypal | |
purchase('productId') |
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
// sign up | |
account.signUp('joe@example.com', 'secret'); | |
// sign in | |
account.signIn('joe@example.com', 'secret'); | |
// sign in via oauth | |
account.signInWith('twitter'); | |
// sign out |
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
// Menu: Create gist from clipboard | |
// Description: Creates a new GitHub Gist with the contents of your current clipboard | |
// Author: Gregor Martynus | |
// Twitter: @gr2m | |
// https://github.com/gr2m/scriptkit-octokit/ | |
const { Octokit } = await npm("scriptkit-octokit"); | |
const octokit = new Octokit({ | |
auth: { | |
scopes: ["gist"], |
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
// Menu: Set GitHub Status with Octokit | |
// Description: Sets the status text on your GitHub Profile | |
const { Octokit } = await npm("scriptkit-octokit"); | |
const octokit = new Octokit({ | |
auth: { | |
scopes: ["user"], | |
env: "GITHUB_TOKEN_SET_USER_PROFILE", | |
}, | |
}); |
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
//Shortcut: command shift - | |
// Menu: Set GitHub Status | |
// Description: Sets the status text on your GitHub Profile | |
const message = await arg("What would you like to say?"); | |
const token = await env("GITHUB_STATUS_TOKEN", { | |
secret: true, | |
ignoreBlur: true, | |
hint: md( | |
`Create a token [on GitHub](https://github.com/settings/tokens/new?scopes=user&description=kit%20script)` |
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
// Menu: Copy GitHub user name | |
// Description: Copies a GitHub user's first name, fallback to @login | |
// Author: Gregor Martynus | |
// Twitter: @gr2m | |
const { Octokit } = await npm("octokit"); | |
const { createOAuthDeviceAuth } = await npm("@octokit/auth-oauth-device"); | |
// set GitHub Token unless it's already set |
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
// send text email | |
sendEmail({ | |
subject: "Hello, World!", | |
text: "This mail has been sent from the frontend", | |
to: "joe@exam.pl" | |
}) | |
// send multipart text / html email | |
sendEmail({ | |
subject: "Hello, World!", |
NewerOlder