Skip to content

Instantly share code, notes, and snippets.

View 6rube's full-sized avatar
🐍
++++[>++++<-]>[<+++++>-]<.>+++[<---->-]<+.>+++[<+++++>-]<-.+.-----.

6rube 6rube

🐍
++++[>++++<-]>[<+++++>-]<.>+++[<---->-]<+.>+++[<+++++>-]<-.+.-----.
View GitHub Profile
@6rube
6rube / x.go
Last active February 3, 2022 10:34
Go Modules
Hell
├── main.go
└── world
└── test.go
------------------------------------------|------------------------------------------
main.go: |test.go:
package main | package world
import "example.com/modulename/world" | import "fmt"
func main(){world.Quest()} | func Quest(){fmt.Println("test done!")}
------------------------------------------|------------------------------------------
@6rube
6rube / Program.cs
Created February 3, 2022 10:33
Async HTTP Post Request with Auth
using System.Net.Http.Headers;
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", "TOKEN"); //Add Authentication (extra)
var data = @"{JSON}"; //JSON String
var buffer = System.Text.Encoding.UTF8.GetBytes(data);
var byteContent = new ByteArrayContent(buffer);
byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/json"); //Type Of Data
var response = await client.PostAsync("http://127.0.0.1/createSomething", byteContent); //URL
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString); //out to terminal (extra)
@6rube
6rube / msg.cs
Last active April 23, 2023 09:51
C# .net 6.0 Messagebox for console applications
using System.Runtime.InteropServices;
//Call Win32 API for opening a Messagebox (This does not require any other libarys)
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);
MessageBox(new IntPtr(0), "Message", "Title", 0);
version: '3.8'
services:
nginx:
image: 'nginxproxy/nginx-proxy:latest'
container_name: 'nginx-proxy'
volumes:
- 'html:/usr/share/nginx/html'
- 'dhparam:/etc/nginx/dhparam'