Skip to content

Instantly share code, notes, and snippets.

View cosminpopescu14's full-sized avatar
🎯
Focusing

Cosmin Popescu cosminpopescu14

🎯
Focusing
View GitHub Profile
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import os
import argparse
def get_args():
# Create the parser
package com.mycompany.app;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.GregorianCalendar;
package com.company;
import java.util.AbstractMap;
import java.util.Map;
import java.util.Set;
public class ArrayMap<K, V> extends AbstractMap<K,V> implements Map.Entry<K,V> {
@Override
public Set<Entry<K, V>> entrySet() {
return null;
@cosminpopescu14
cosminpopescu14 / CurlWrapper.cpp
Created August 17, 2020 05:38
Simple curl wrapper for C++
#include "CurlWrapper.h"
#include <ostream>
CurlWrapper::CurlWrapper(CURLoption _options...)
{
this->req = curl_easy_init();
this->options = _options;
curl_easy_setopt(req, _options, "https://jsonplaceholder.typicode.com/todos");// just to test
}
package com.company;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD) //can use in method only.
// JsonApi.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "curl/curl.h"
#include "JsonApi.h"
#include "json.hpp"
using namespace std;
@cosminpopescu14
cosminpopescu14 / CompletedAndNotCompleted.kt
Created July 19, 2020 06:50
Agregate completed and not complted todos form an api
import com.beust.klaxon.Json
import com.beust.klaxon.Klaxon
import java.net.HttpURLConnection
import java.net.URL
fun main() {
val url = URL("https://jsonplaceholder.typicode.com/todos")
var resultJson = ""
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
require "vendor/autoload.php";
$url = "http://jsonplaceholder.typicode.com/todos";
$client = new Client();
package com.company;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>groupId</groupId>
<artifactId>JsonApiPlay</artifactId>
<version>1.0-SNAPSHOT</version>