Skip to content

Instantly share code, notes, and snippets.

View fecf's full-sized avatar

fecf

  • Tokyo, Japan
  • 17:35 (UTC +09:00)
View GitHub Profile
### Keybase proof
I hereby claim:
* I am fecf on github.
* I am fecf (https://keybase.io/fecf) on keybase.
* I have a public key ASBUwPxI_Vk8ZMpRKESDSYg-hc7cTjxRjIsIPZcck_EsUgo
To claim this, I am signing this object:
# Remote
Enable-PSRemoting -force
# Local
Set-Item wsman:\localhost\client\TrustedHosts -value *
Enter-PSSession -ComputerName 100.0.0.0 -Credential (Get-Credential -UserName a -Message "a")
@fecf
fecf / main.cc
Created June 13, 2021 23:08
minimal windows app with tasktray icon
constexpr DWORD kNotifyTrayIcon = WM_APP + 100;
NOTIFYICONDATA g_nid;
HMENU g_hMenu;
LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam) {
switch (uMsg) {
case WM_CREATE: {
g_hMenu = CreatePopupMenu();
MENUITEMINFO mii{};
@fecf
fecf / gpuusage.h
Last active July 29, 2024 06:52
get GPU utilization
#pragma once
#include <chrono>
#include <iostream>
#include <regex>
#include <vector>
#include <pdh.h>
#include <pdhmsg.h>
#include <strsafe.h>
@fecf
fecf / remixicon_css_h.py
Last active June 4, 2020 05:45
convert remixicon .css to c++ header
import os
import re
css = os.path.abspath(os.path.join(os.path.dirname(__file__), 'remixicon.css'))
f = open(css, "r")
found = False
defines = []
smin = ""
smax = ""
@fecf
fecf / server.cc
Created August 28, 2018 11:37
bare minimum websocket server with c++/winrt
...
using namespace winrt::Windows::Foundation;
using namespace winrt::Windows::Networking::Sockets;
using namespace winrt::Windows::Storage::Streams;
using namespace winrt::Windows::Security::Cryptography;
using namespace winrt::Windows::Security::Cryptography::Core;
StreamSocketListener websocket_;