Skip to content

Instantly share code, notes, and snippets.

@Y-Koji
Y-Koji / display_off.c
Created March 17, 2018 09:50
ノートPCのディスプレイ電源を切るプログラム
#include <stdio.h>
#include <windows.h>
#include <winuser.h>
#pragma comment(lib, "user32.lib")
#define DISPLAY_ON (-1)
#define DISPLAY_OFF (2)
@Y-Koji
Y-Koji / Json.Linq.JDocument.cs
Last active August 16, 2020 11:08
Linq to Json
using System.Xml.Linq;
namespace Json.Linq
{
public class JDocument : XDocument
{
public JDocument() : base() { }
public JDocument(params object[] content) : base(content) { }
public JDocument(XDocument other) : base(other) { }
public JDocument(XDeclaration declaration, params object[] content) : base(declaration, content) { }
; https://github.com/karakaram/alt-ime-ahk
#include alt-ime-ahk.ahk
; vk1D: 無変換
vk1D & 0::Reload
vk1D & 8::Edit
vk1D & h::Send,{Blind}{Left}
vk1D & l::Send,{Blind}{Right}
vk1D & k::Send,{Blind}{Up}
@Y-Koji
Y-Koji / command.cmd
Last active August 15, 2018 14:22
クローリング用wgetコマンド
# Windows Command Prompt.
set url=https://google.co.jp/
wget -r -l 0 -random-wait --restrict-file-names=windows -np -N -E -k -T 15 "%url%"
# Linux(bash)
url=https://google.co.jp/
wget -r -l 0 -random-wait --restrict-file-names=windows -np -N -E -k -T 15 "$url"
@Y-Koji
Y-Koji / smma.mq5
Created August 16, 2018 12:41
MT5 SMMA 描画スクリプト
#property copyright "SMMA Sample Indicator."
#property link ""
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots 3
// 移動平均短期スパン描画設定
#property indicator_label1 "SMMA Short"
@Y-Koji
Y-Koji / Argument.cs
Last active September 28, 2018 11:55
C# 引数パーサ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
public class Argument
{
public static T Parse<T>(string[] args)
{
object obj = Activator.CreateInstance<T>();
@Y-Koji
Y-Koji / Register_PowerShell.reg
Last active January 26, 2023 17:36
PowerShell ダブルクリック起動Windows設定
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command]
@="\"C:\\Program Files\\PowerShell\\6.0.3\\pwsh.exe\" -noLogo -ExecutionPolicy unrestricted -file \"%1\""
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon]
@="\"C:\\Program Files\\PowerShell\\6.0.3\\pwsh.exe\",0"
[HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\ShellEx\DropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
@Y-Koji
Y-Koji / set-brightness.ps1
Created October 22, 2018 12:01
[PowerShell] 画面輝度変更
$brightness = 30;
$timeout = 5;
[Console]::Write("Brightness[0-100%]> ");
$brightness = [int] [Console]::ReadLine();
Get-CimInstance -Namespace root/wmi -Class WmiMonitorBrightnessMethods |
Invoke-CimMethod -MethodName WmiSetBrightness -Arguments @{ Brightness = $brightness; Timeout = $timeout; } > $null
@Y-Koji
Y-Koji / SqlFormatter.cs
Created November 10, 2018 05:04
SQL整形プログラム
using System;
using System.Linq;
using System.Text;
namespace TxtTools
{
public class SqlFormatter
{
private static class Status
{
@Y-Koji
Y-Koji / copy-cookie.js
Created November 23, 2018 10:01
クリップボードにCookieをコピーする奴