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 | |
| import requests | |
| def load_config(config_path): | |
| with open(config_path, 'r') as file: | |
| config = json.load(file) | |
| return { | |
| "endpoint": config["endpoint"], |
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 | |
| import os | |
| import traceback | |
| import requests | |
| def load_config(config_path): | |
| with open(config_path, 'r') as file: | |
| config = json.load(file) |
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
| #!/usr/bin/env python3 | |
| """ | |
| A simple package manager for Python inspired by npm. | |
| It uses pip and uv to manage dependencies. | |
| Usage: | |
| Initialize a new package: | |
| dep.py init <name> |
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 sqlite3 | |
| # Path to your SQLite file | |
| sqlite_file = 'your_database.sqlite' | |
| # Connect to the SQLite database | |
| conn = sqlite3.connect(sqlite_file) | |
| cursor = conn.cursor() | |
| # Get the table names |
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 | |
| import sqlite3 | |
| import sys | |
| def create_table_from_json(json_file, table_name): | |
| # Load JSON data | |
| with open(json_file, 'r') as file: | |
| json_data = json.load(file) | |
| # Retrieve the first element of the JSON array to infer schema |
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
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "fmt" | |
| "github.com/joho/godotenv" | |
| "github.com/slack-go/slack" | |
| "github.com/slack-go/slack/slackevents" | |
| "github.com/slack-go/slack/socketmode" |
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
| pipeline { | |
| job { | |
| timeout = 12000 | |
| } | |
| } |
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
| def sh(String command) { | |
| return new ShellCommand(command) | |
| } | |
| class JobSpec { | |
| def name | |
| def steps = [] | |
| def artifacts = [] | |
| public JobSpec(name) { | |
| this.name = name | |
| } |
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
| class PipelineSpec { | |
| def input, output | |
| def maps = [] | |
| def filters = [] | |
| def input(String id) { | |
| this.input = input | |
| } | |
| def output(String id) { | |
| this.output = output |
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
| def pipeline(Closure<Void> cl) { | |
| def pipelineSpec = new PipelineSpec() | |
| cl.delegate = pipelineSpec | |
| cl() | |
| pipelines << pipelineSpec.build() | |
| } |
NewerOlder