Skip to content

Instantly share code, notes, and snippets.

View gregyjames's full-sized avatar
:octocat:
Available

Greg gregyjames

:octocat:
Available
View GitHub Profile
@gregyjames
gregyjames / tiny.dockerfile
Created December 24, 2023 11:24
Tiniest possible GO Docker image
FROM golang:alpine as golang
# Create appuser (only for scratch)
ENV USER=appuser
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
@sven-bock
sven-bock / threadpool.cpp
Last active December 18, 2023 14:02
Sample how to create a boost threadpool in a class
#include <boost/asio/io_service.hpp>
#include <boost/bind.hpp>
#include <boost/thread/thread.hpp>
#include <boost/make_shared.hpp>
#include <iostream>
class Bla{
public:
void callback(std::string msg){
@rwev
rwev / BAW.py
Last active March 1, 2024 02:33
Python implementation of the Barone-Adesi And Whaley model for the valuation of American options and their greeks.
"""
BAW.PY
Implements the Barone-Adesi And Whaley model for the valuation of American options and their greeks.
"""
import numpy as _np
import cmath as _cm
# Option Styles
@dimitrispaxinos
dimitrispaxinos / SerilogHttpClientWrapper.cs
Last active April 1, 2023 17:06
HttpClient Wrapper with logging functionality using Serilog
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Serilog.Context;
namespace Serilog.RestCallMonitoring
{
public class SerilogHttpClientWrapper : HttpClient
{
private static string _templateString =
@santanuchakrabarti
santanuchakrabarti / RE_to_Grammar_Algorithm.md
Last active December 5, 2021 21:12
An algorithm to generate a Regular Grammar from a Regular Expression
@takekazuomi
takekazuomi / csharp.gitignore
Created April 17, 2014 05:47
.gitignore for C#
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
@peterk87
peterk87 / Parse Genbank file using BioPython.py
Last active January 7, 2022 22:33
Python: Parse Genbank file using BioPython
import os
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, FeatureLocation
from Bio import SeqIO
# get all sequence records for the specified genbank file
recs = [rec for rec in SeqIO.parse("genbank_file.gbk", "genbank")]
# print the number of sequence records that were extracted