Skip to content

Instantly share code, notes, and snippets.

View yevhen's full-sized avatar
🇺🇦

Yevhen Bobrov yevhen

🇺🇦
View GitHub Profile
/* eslint-disable no-console */
/* eslint-disable prefer-arrow-callback */
import expect from 'expect';
import { createTestClient } from 'apollo-server-testing';
import ggl from 'graphql-tag';
import config from '../../../config';
import { createServer } from '../../../src/server';
@Horusiath
Horusiath / Program.fs
Last active April 9, 2020 13:19
Toy implementation of SWIM protocol in Akkling (Akka.NET F#)
open System
open System.Threading
open Akkling
open DemoFs
[<EntryPoint>]
let main argv =
let config = """
akka.loglevel = DEBUG

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active October 31, 2024 20:59
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
@ninjarobot
ninjarobot / strace-netcore.md
Last active May 24, 2022 19:22
Trace .NET Core Applications on Linux with `strace`

Trace .NET Core Applications on Linux with strace

Troubleshooting a running application can be difficult, usually it starts around checking log output and then following through the likely code paths to get an idea of where a failure may occur. In a development environment, you might attach a debugger a step through source, but troubleshooting isn't always that convenient. There are several helpful tools that can assist, but one that gives the most comprehensive view of a running application is strace. With strace you are able to see all of the system calls an application makes to get a detailed understanding of what is going on "under the hood" in order to troubleshoot an issue.

Take a simple "hello world" F# application, the kind you get from dotnet new console -lang F# -n strace-sample". Build it with dotnet build and then launch it with strace to get a trace of all the system calls in a file called trace.log(adjusting for your build output path if on a different framework vers

@dmfigol
dmfigol / asyncio_loop_in_thread.py
Last active November 14, 2024 08:52
Python asyncio event loop in a separate thread
"""
This gist shows how to run asyncio loop in a separate thread.
It could be useful if you want to mix sync and async code together.
Python 3.7+
"""
import asyncio
from datetime import datetime
from threading import Thread
from typing import Tuple, List, Iterable
@abdullin
abdullin / SampleTracer.cs
Created March 20, 2018 08:59
A sample code to generate JSON dumps according to the catapult event format. Not used any more (planning to write a new one some time later).
public sealed class Tracer {
int _traceId;
readonly Func<long> _clock;
StreamWriter _writer;
public Tracer(Func<long> clock) {
_clock = clock;
@eriadam
eriadam / example-jenkinsfile-pipeline.groovy
Last active March 31, 2024 15:14
example-jenkinsfile-pipeline.groovy
#!groovy
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
@ysegorov
ysegorov / Jenkinsfile
Last active April 8, 2021 14:31
Jenkinsfile example
#!/usr/bin/env groovy
// https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-test.groovy
// http://stackoverflow.com/a/40294220
// https://JENKINS_HOST/scriptApproval/ - for script approval
import java.util.Date
def isMaster = env.BRANCH_NAME == 'master'
def isDevelop = env.BRANCH_NAME == 'develop'
@tugberkugurlu
tugberkugurlu / ComplexTypeConvention.cs
Created April 6, 2016 15:16
Bind complex type objects from body by default on ASP.NET Core 1
using Microsoft.AspNet.Mvc.ApplicationModels;
using Microsoft.AspNet.Mvc.ModelBinding;
using System;
namespace Foo.Web.Infrastructure.Conventions
{
public class ComplexTypeConvention : IActionModelConvention
{
public void Apply(ActionModel action)
{