Skip to content

Instantly share code, notes, and snippets.

@Elfocrash
Elfocrash / IntegrationTest.cs
Created July 10, 2019 10:40
ASP.NET Core Integration tests code from my video: https://www.youtube.com/watch?v=7roqteWLw4s
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Tweetbook.Contracts.V1;
using Tweetbook.Contracts.V1.Requests;
using Tweetbook.Contracts.V1.Responses;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sam016
sam016 / AllGattCharacteristics.java
Last active May 4, 2024 20:46
Bluetooth GATT Services & Characteristics
package com.sam016.vsflatomation.service.ble;
import java.util.HashMap;
import java.util.UUID;
public class AllGattCharacteristics {
private static HashMap<String, String> attributes = new HashMap();
static {
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name");
@jakobii
jakobii / HTTPServer.ps1
Last active May 4, 2024 14:02
A Basic Powershell Webserver
# You Should be able to Copy and Paste this into a powershell terminal and it should just work.
# To end the loop you have to kill the powershell terminal. ctrl-c wont work :/
# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
@tanaikech
tanaikech / submit.md
Last active January 4, 2024 09:59
Transposing Slice From (n x m) To (m x n) for golang

Transposing Slice From (n x m) To (m x n) for golang

This is a sample script for transposing slice from (n x m) to (m x n) for golang.

Script :

package main

import "fmt"

func transpose(slice [][]string) [][]string {
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@libertylocked
libertylocked / Primitives2D.cs
Last active February 14, 2022 12:02
MonoGame Primitives2D (Fixed pixels offset for DrawLine)
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace C3.XNA
{
/// <summary>
/// </summary>
public static class Primitives2D
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@maxvyaznikov
maxvyaznikov / raw.js
Last active October 15, 2022 02:19
NodeJS, raw-socket, custom TCP/IPv4 SYN-packet sending
var raw = require("raw-socket");
var ip = require('ip');
var util = require('util');
function send(src_ip, src_port, dst_ip, dst_port) {
var socket = raw.createSocket({
protocol: raw.Protocol.TCP, // See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
addressFamily: raw.AddressFamily.IPv4
});
@swlaschin
swlaschin / Calculator_implementation.fsx
Last active July 30, 2023 14:50
Type-first design and implementation for a calculator app
(*
Calculator_implementation.fsx
Related blog post: http://fsharpforfunandprofit.com/posts/calculator-implementation/
*)
// ================================================
// Draft of Domain from previous file
// ================================================
module CalculatorDomain_V3 =