Skip to content

Instantly share code, notes, and snippets.

View henkman's full-sized avatar
🌶️

henkman henkman

🌶️
View GitHub Profile
@henkman
henkman / winhttp_https_put.c
Last active December 15, 2023 09:14
https request in winhttp
#include <stdio.h>
#include <windows.h>
#include <winhttp.h>
static int http_put(wchar_t *host, short port, wchar_t *path, char *data, size_t size)
{
int code = 0;
HINTERNET hSession = WinHttpOpen(NULL,
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
WINHTTP_NO_PROXY_NAME,
@henkman
henkman / test.c
Last active May 4, 2018 16:17
C struct embedding
// gcc -std=c99 -Wall -s -O3 -fms-extensions -Wno-microsoft-anon-tag -o test test.c
// clang -std=c99 -Wall -s -O3 -fms-extensions -Wno-microsoft-anon-tag -o test test.c
#include <stdio.h>
typedef struct
{
unsigned a;
} A;
@henkman
henkman / .jshintrc
Created May 4, 2018 12:45
jshint.cmd -c .jshintrc asd.js
{
"curly": true,
"esversion": 6,
"maxdepth": 6,
"unused": true,
"undef": true,
"browser": true,
"jquery": true
}
@henkman
henkman / Makefile
Created March 29, 2018 18:44
kill foreground window with CTRL+ALT+END in case task manager fails
SRCS=wkill.c
OBJS=$(SRCS:.c=.o)
CFLAGS=-std=c11 -pedantic -Wall -O3 -nostdlib -fno-asynchronous-unwind-tables -fno-builtin -fno-ident -ffunction-sections -fdata-sections
LIBS=-luser32 -lkernel32
LDFLAGS=-static -nostdlib -fno-builtin -s -Wl,-e,__main,--gc-sections,-subsystem,windows $(LIBS)
NAME=wkill
EXE=$(NAME).exe
.PHONY: all clean
<%@ page language="java" buffer="60kb" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="java.util.Set, java.util.Map" %>
<!doctype html>
<html>
<head><title>info</title></head>
<body>
<table>
<%
for(Map.Entry<Object,Object> entry : System.getProperties().entrySet()) {
%>
package main
import (
"encoding/binary"
"errors"
"flag"
"fmt"
"syscall"
"time"
"unsafe"
set palette="palette.png"
set filters="fps=%4,scale=%3:-1:flags=lanczos"
ffmpeg -v warning -i %1 -vf "%filters%,palettegen" -y %palette%
ffmpeg -v warning -i %1 -i %palette% -lavfi "%filters% [x]; [x][1:v] paletteuse" -y %2
{
"response_type": "in_channel",
"text": ":bongo1::bongo2:\n:bongo3::bongo4:"
}
{
"response_type": "in_channel",
"text": ":bear1::bear2:\n:bear3::bear4:"
}
{
"response_type": "in_channel",
"text": ":hamster1::hamster2:\n:hamster3::hamster4:"
}