Skip to content

Instantly share code, notes, and snippets.

View pbn4's full-sized avatar

Michał Plebański pbn4

View GitHub Profile
@pbn4
pbn4 / gist:5ad874ad5d13112c6f6c8c2c39ad6ae8
Created October 27, 2022 09:52
github_repository_file debug output
2022-10-27T11:49:55.890+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: PUT /repos/michal-plebanski-clearscale/my-test-repository-name/contents/.git/hooks/commit-msg HTTP/1.1
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: Host: api.github.com
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: User-Agent: go-github/v47.0.0
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: Content-Length: 99
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: Accept: application/vnd.github.v3+json
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: Content-Type: application/json
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: Accept-Encoding: gzip
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0:
2022-10-27T11:49:55.891+0200 [DEBUG] provider.terraform-provider-github_v4.31.0: {
2022-10-27T11:49:55.891+020
[package]
name = "testapp"
version = "0.1.0"
authors = ["Michal Plebanski <michalp@airnauts.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
postgres = "0.17.0"
@pbn4
pbn4 / gist:ea14f0ca0a25fb376523ab850327abfb
Created January 29, 2020 07:02
How to insert HashMap into PostgreSQL as JSON type?
use postgres::{Client, NoTls};
use serde::{Deserialize, Serialize};
use postgres_types::{ToSql, FromSql};
#[derive(Debug, Deserialize, Serialize, ToSql, FromSql)]
struct relations {
name : String,
hobby: Vec<String>
}
"SELECT DISTINCT "distinctAlias"."itineraryRequest_id" as "ids_itineraryRequest_id", "distinctAlias"."itineraryRequest_created_at" FROM (SELECT "itineraryRequest"."id" AS "itineraryRequest_id", "itineraryRequest"."uuid" AS "itineraryRequest_uuid", "itineraryRequest"."created_at" AS "itineraryRequest_created_at", "itineraryRequest"."email" AS "itineraryRequest_email", "itineraryRequest"."name" AS "itineraryRequest_name", "itineraryRequest"."phone_number" AS "itineraryRequest_phone_number", "itineraryRequest"."how_did_you_hear_about_us" AS "itineraryRequest_how_did_you_hear_about_us", "itineraryRequest"."questions" AS "itineraryRequest_questions", "itineraryRequest"."trip_id" AS "itineraryRequest_trip_id", "trip"."id" AS "trip_id", "trip"."uuid" AS "trip_uuid", "trip"."created_at" AS "trip_created_at", "trip"."start_date" AS "trip_start_date", "trip"."end_date" AS "trip_end_date", "trip"."cms_title" AS "trip_cms_title", "trip"."tag" AS "trip_tag", "trip"."status" AS "trip_status", "trip"."base_price" AS "trip_b
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
for(vector<int> v: this->compounds){
if (find(v.begin(), v.end(), a) != v.end() &&
find (v.begin(), v.end(), b) != v.end()){
return true;
}
else{
return false;
}
#include <stdio.h>
#include <memory.h>
#include <stdlib.h>
char buffer[1000];
int main(){
while(fgets(buffer, sizeof(buffer), stdin)){
$ cat Hello.scala
import Chisel._
class HelloModule extends Module {
val io = new Bundle {}
printf("Hello World!\n")
}
class HelloModuleTests(c: HelloModule) extends Tester(c) {
step(1)
import scala.io.StdIn.{readLine, readInt}
object Scala{
def main(args:Array[String]){
var line = scala.io.StdIn.readLine.toInt
var tmp = scala.io.StdIn.readLine.toInt
println(line)
println(tmp)
}
}