Skip to content

Instantly share code, notes, and snippets.

@Elfocrash
Elfocrash / IntegrationTest.cs
Created Jul 10, 2019
ASP.NET Core Integration tests code from my video: https://www.youtube.com/watch?v=7roqteWLw4s
View IntegrationTest.cs
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;
View Wine_preferences_note_book.ipynb
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 Oct 23, 2021
Bluetooth GATT Services & Characteristics
View AllGattCharacteristics.java
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 Oct 24, 2021
A Basic Powershell Webserver
View HTTPServer.ps1
# 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 Jun 1, 2021
Transposing Slice From (n x m) To (m x n) for golang
View submit.md

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 Oct 21, 2021
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active Oct 23, 2021
A sample README for all your GitHub projects.
View sampleREADME.md

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@maxvyaznikov
maxvyaznikov / raw.js
Last active Apr 17, 2020
NodeJS, raw-socket, custom TCP/IPv4 SYN-packet sending
View raw.js
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 Jun 5, 2020
Type-first design and implementation for a calculator app
View Calculator_implementation.fsx
(*
Calculator_implementation.fsx
Related blog post: http://fsharpforfunandprofit.com/posts/calculator-implementation/
*)
// ================================================
// Draft of Domain from previous file
// ================================================
module CalculatorDomain_V3 =
@benbalter
benbalter / gist.md
Last active May 24, 2021
Example of how to embed a Gist on GitHub Pages using Jekyll.
View gist.md

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.