Skip to content

Instantly share code, notes, and snippets.

View jenol's full-sized avatar
💭
I may be slow to respond.

Jeno Laszlo jenol

💭
I may be slow to respond.
  • Betsson
  • Hungary
View GitHub Profile
@jenol
jenol / scheduling_dsl_idea.js
Created November 18, 2022 15:46
scheduling_dsl_idea.js
/*
# ┌───────────── start minute (0 - 59)
# │ ┌───────────── start hour (0 - 23)
# │ │ ┌──────────── end minute (0 - 59)
# │ │ │ ┌───────────── end hour (0 - 23)
# │ │ │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
# │ │ │ │ │ │ │
$ErrorActionPreference = "Stop"
$githubAuth = "get your own token"
$organization = "your org"
$repoName = "your repo"
$repo = Invoke-RestMethod -Method Get -Uri "https://api.github.com/repos/$organization/$repoName" -Headers @{
Authorization = "bearer $githubAuth"
Accept = "application/vnd.github.v3+json"
} -Body $body -UseBasicParsing
const sodium = require('tweetsodium');
const { Octokit } = require("octokit");
const fs = require('fs');
const util = require('util');
const path = require("path");
const readFile = util.promisify(fs.readFile);
(async () => {
const githubAuth = "use your own"
const sonarCloudConfigFileName = "sonarcloud-runner.yml"
@jenol
jenol / github-graphql-mock-server.js
Last active February 10, 2022 14:45
Example of how you can create a mock server using an existing servers introspection info.
const express = require('express');
const { graphqlHTTP } = require('express-graphql');
const { getIntrospectionQuery, buildClientSchema } = require('graphql');
const { request } = require('graphql-request');
const fs = require("fs");
const util = require("util");
const mocker = require('easygraphql-mock');
const token = "user your own";
@jenol
jenol / upload-or-update-file-and-create-pull-request.ps1
Created February 2, 2022 17:52
Script to create a new github pull request and add and update a file.
$ErrorActionPreference = "Stop"
#https://github.com/settings/tokens/new?scopes=repo
$githubAuth = "use your own"
$headers = @{
Accept = "application/vnd.github.v3+json"
Authorization = "bearer $githubAuth"
}
$baseUrl = "https://api.github.com"
function Get-GitResource($url) {
@jenol
jenol / SwaggerDocService.scala
Last active March 16, 2018 07:31
x-nullable for swagger-akka-http
class SwaggerDocService(canonicalHost: String, canonicalPort: Int)(
implicit override val actorSystem: ActorSystem,
override val materializer: ActorMaterializer
) extends SwaggerHttpService
with HasActorSystem {
override val apiTypes = Seq(
// your routes
typeOf[XNullableExtender] // you register listeners the same way as routes. The reader will sort out what is what
)
@jenol
jenol / ApplySchemaVendorExtensions.cs
Last active August 21, 2019 17:43
x-nullable for Swashbuckle
public class ApplySchemaVendorExtensions : ISchemaFilter
{
public void Apply(Schema schema, SchemaRegistry schemaRegistry, Type type)
{
if (type.IsArray && type.GetElementType() != typeof(byte))
{
// Special case
return;
}