Skip to content

Instantly share code, notes, and snippets.

View cosminpopescu14's full-sized avatar
🎯
Focusing

Cosmin Popescu cosminpopescu14

🎯
Focusing
View GitHub Profile
@georgiana-gligor
georgiana-gligor / most_recent.php
Last active December 20, 2018 07:40
preg_replace vs str_replace
<?php
$channels = array(
"UCgpy7yxv_7JbR26McdS1uQA",
"UCrHZJ6fddxeK2wwPIh5-O4Q",
"UCYUI-AaHyYslLLWAss4EiAA",
);
$res = 5;
$key = 'YOUR_KEY_HERE';
@GeorgianStan
GeorgianStan / FrontEnd.js
Last active August 5, 2019 09:04
JWT Ex
const whoAmI = async () => {
/**
* * 1. Create the query
* * 2. Send the query and get the response as object
* * 3. If there was an error then throw it
* * 4. Otherwise return the result
*/
// * 1
const query = "{ whoAmI { id profilePicture email confirmed } }";
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MimeKit;
using MimeKit.Text;
@aromanro
aromanro / CallApi.cpp
Last active August 16, 2020 10:43
How to use boost for a https api call
#include <iostream>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/beast.hpp>
#include <boost/format.hpp>
@mfaella
mfaella / L.java
Last active April 18, 2021 10:24
A list-like class exposing its length as part of its type (see https://medium.com/@marfaella/counting-with-java-generics-ad33c5ef434d)
import java.util.*;
/**
* A linked list that exposes its length as part of its type.
*
* @author Marco Faella
* @version 1.0
*/
public class L<T,N extends L<T,?>> implements Iterable<T> {
private T item;
@stuart-marks
stuart-marks / ReadFileJavaApplicationBufferedReader7.java
Last active May 3, 2021 10:39
Processing Large Files in Java, Variation 7
package com.example.readFile.readFileJava;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Collections;
@Hakky54
Hakky54 / cheat_sheet_http_client_ssl_configuration_for_java_kotlin_scala.md
Last active August 18, 2022 11:56
Cheat Sheet - Http Client SSL TLS Configuration for Java Kotlin and Scala with example http requests
@geosoft1
geosoft1 / main.go
Last active November 17, 2022 18:02
Simple blockchain example
package main
import (
"crypto/sha256"
"encoding/hex"
"strconv"
"time"
)
type Data struct {
@pushpendre
pushpendre / pid_control_servers.ipynb
Created July 4, 2021 19:49
PID Controller for controlling the number of servers in a data-center. This notebook accompanies the video https://youtu.be/pKuVUmpYkLk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.