Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
:)

Cosmin Popescu cosminpopescu14

:octocat:
:)
View GitHub Profile
View JsonApiPlay.cpp
// 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 Jul 19, 2020
Agregate completed and not complted todos form an api
View CompletedAndNotCompleted.kt
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 = ""
View CompletedAndNotCompleted.php
<?php
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
require "vendor/autoload.php";
$url = "http://jsonplaceholder.typicode.com/todos";
$client = new Client();
View JavaPlayTodosApi.java
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;
View MavenSupportConfigForJava.xml
<?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>
View JavaPlay.java
package com.company;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.util.Arrays;
View DifferentApproachesToGetSchema.cs
using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Threading.Tasks;
namespace JsonPlay
{
@cosminpopescu14
cosminpopescu14 / FromHashcodeToColor.cs
Last active Apr 25, 2020
Generate a rgb color from a hashcode
View FromHashcodeToColor.cs
using System;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using HashcodeToColor;
namespace HashcodeToColor
{
@cosminpopescu14
cosminpopescu14 / main.cs
Created Mar 22, 2020 — forked from gistlyn/main.cs
Simple OrmLite CRUD demo
View main.cs
using System;
using System.Collections.Generic;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
public class User
{
View count_duplicate_properties_from_array_of_objects.js
const clienti = [
{ idClient: 121, idJudet: 1 },
{ idClient: 221, idJudet: 1 },
{ idClient: 343, idJudet: 2 }];
let dupes = {};
let rez = [];
clienti.forEach(count => {
You can’t perform that action at this time.