Github API examples & templates
Use these vals as a playground to view and fork Github API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
maxm
imageToAscii
Script
Copyright (c) 2018 Victor Ribeiro - victorqribeiro@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
https://github.com/victorqribeiro/imgToAscii
0
jonasmerlin
bluesky_bot_template
Cron
This is a very simple template for the kind of Bluesky bot I build. It's very much all over the place. e.g. it sets up the "Agent" to post (because that part is documented well), but doesn't use it to search for posts. You can do that if you want (if you do, look here ), but I like to simply rawdogg the API, so that is what I'm doing here.
The custom Post type is incomplete and only contains the stuff I found relevant.
Error handling is payed only lip service to (at best) as well. ...But it works for me! How to use If you want to use this, you will have to set 2 environment variables for your val:
BLUESKY_USERNAME
BLUESKY_PASSWORD
From what I can tell from my testing: BLUESKY_USERNAME can be both the bot account's handle as well as the email you use to log into it with. BLUESKY_PASSWORD can be both the account's main password as well as an app password. The rest is commented in the code. If you have any questions, feel free to message me on Bluesky: Jonas-Merlin Schumacher (@jonasmerlin.bsky.social) — Bluesky
1
dthyresson
graphQLYoga
HTTP
GraphQL Yoga Server GraphQL Yoga from The Guild is a batteries-included cross-platform GraphQL over HTTP spec-compliant GraphQL server
powered by Envelop
and GraphQL Tools focused on easy setup, performance and great developer experience. Usage To access GraphiQL - the GraphQL Playground - visit the / route.
That's what you see in the preview pane below. Configuration and Documentation See the GraphQL Yoga documentation for configuration and all the bells and whistles. Endpoint For this example, we'll set to / to make it easier to demo. However, by default, the GraphQL route is configured to be on /graphql which is more common. const yoga = createYoga({
schema,
}) You can set a custom endpoint: const yoga = createYoga({
schema,
graphqlEndpoint: "/my-gql",
}) Landing Page A landing page is shown be default whenever a 404 is hit. You can disable it via the landingPage option. const yoga = createYoga({
schema,
landingPage: false
})
0