Skip to content

Instantly share code, notes, and snippets.

View rozaydin's full-sized avatar
🎯
Focusing

Rıdvan Özaydın rozaydin

🎯
Focusing
View GitHub Profile
@rozaydin
rozaydin / list.md
Created August 18, 2021 05:37 — forked from ih2502mk/list.md
Quantopian Lectures Saved
@rozaydin
rozaydin / hns_bid_tx
Created July 12, 2021 15:56
hns_open_tx
{
"hash": "07e5c1a5aa0dcd9e0e0ed1f3f23944a57951417a7d0259cdc48dfd23b8cc2c2d",
"witnessHash": "9f48340abe69236870dea9bd13cd1972cea17c6b0796958a2e1edaf9350dc1af",
"mtime": 1626105122,
"version": 0,
"inputs": [
{
"prevout": {
"hash": "30b5b56d899ee2d9fd522fe5bd48a07b4c75b95ad823fabdfd5e361a860e4208",
"index": 0
@rozaydin
rozaydin / sample_pistache.cpp
Created May 5, 2020 06:27
Sample Pistache Server
// Rest Server
void restServer(AfSIPProcessor *afSipProcessor, int sipSockHandle, Logger *pLogger)
{
class ConfigServerMockRestHandler : public Pistache::Http::Handler
{
private:
AfSIPProcessor *afSipProcessor;
const int sipSockHandle;
@rozaydin
rozaydin / HashMapRacer.java
Created March 12, 2020 07:32
Hazelcast Demo
import java.util.HashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.IntStream;
public class HashMapRacer {
//
private final HashMap<String, Long> raceTrack;
sudo ssh-keygen -A
vim /etc/ssh/sshd_config
// set port to 2222 and make it listen 0.0.0.0 and PasswordAuthentication yes
sudo service ssh --full-restart
// all ready to go
@Primary
@Bean("AwsSqs")
public AmazonSQSAsync createAWSSQSClient() {
String endpoint = "http://localhost:9324";
String region = "elasticmq";
String accessKey = "x";
String secretKey = "x";
AmazonSQSAsync client =
AmazonSQSAsyncClientBuilder.standard()
@rozaydin
rozaydin / template.gradle
Created November 30, 2017 07:06
Gradle Template For Java Projects
group 'com.rhtech'
version '1.0-SNAPSHOT'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(
'org.springframework.boot:spring-boot-gradle-plugin:1.5.8.RELEASE'
@rozaydin
rozaydin / JWTUtilTest.java
Created November 5, 2017 13:17
Removed comments for clarity
@Test
public void JWTwithPaddingInBody() throws JoseException, org.jose4j.jwt.consumer.InvalidJwtException
{
String jwt_3 = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiIwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMSIsInN1YiI6IjAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxIiwiYXVkIjoiTWluZFNwaGVyZSBBUyIsImlhdCI6MTUwOTM1MjI5NywibmJmIjoxNTA5MzUyMjk3LCJleHAiOjE1MDk0Mzg2OTcsInNjaGVtYXMiOlsidXJuOnNpZW1lbnM6bWluZHNwaGVyZTp2MSJdLCJ0ZW4iOiJ0ZXN0LXRlbmFudCIsImp0aSI6IjkxODE3YTJkLTU0ZjQtNDQ1OC04YTI5LWU5MGU5ZDQ3YTViIn0=.G6U2GGJX0VCd6VW8-E4HnuvyRTNgct1oauornnOep_MMa8h-cDp8W6ca2LncYM2DaSpeVdO8haIuaAO3Z-vniDQqFa-__fZZvmDNex7D4YAFUqP5ZcW5wF9I3d73Y4uQ0uO07zBxbmZ4vCo6FtgtmwnyfY-BYV6Ag-ci0pw3ADD5uNEdrzL97Tcv500izRg09OuMIbppFkhVEwpWr1vl8Y-5_3gRfALLRBerc73Hcu-fcyXUJdOQTx-Qm3Ickr5bbNzcNsNUbhaNfI3Ij-dnM5IafdqsYbWKK7sbzhineOoldbn5Y0NqzdaHhUzKYjKhcB1sCDBG5E09z_HU00VNCjWCRFjAQTMvCHRUDKAoBOyhIufoKCLyh7zDfj5_OthX9DaCx_3Jg9hk2NcK-JjhN3QZTx2C38KB82YHFJNuUSd-K1I1WEBhfwebbhZPygKBv30OBUQ3V8DGmHDwyTUPMUFS-1CX5xEB4jSITQRyMeMsk3D
@rozaydin
rozaydin / arraysaslist.java
Created April 13, 2017 08:29
JUnit Tests that show fixed-size list is unmutable and add, remove, clear methods throw UnsupportedOperationException
package org.mshowto;
import org.junit.Before;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;
public class arraysaslist {
@rozaydin
rozaydin / CancelScenario4.java
Last active March 14, 2017 14:00
# Future<T> cancel(true) - Task starts execution - cancel(true) called - get() throws CancellationException - Worker Thread gets interrupted - Worker Thread although cancelled continues execution
package org.tutorial.future;
import org.tutorial.future.task.FibonacciTask;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**