Skip to content

Instantly share code, notes, and snippets.

Windows 2012 R2のHyper-V用NAT
New-VMSwitch -SwitchName "Hyper-V-Switch" - SwitchType Internal
Get-NetIPAddress -InterfaceAlias "vEthernet (Hyper-V-Switch)"
IPAddress : 169.254.141.105 ……… 適当なものが振られる
InterfaceIndex : n ………………… 後で使う
InterfaceAlias : vEthernet (Hyper-V-Switch)
AddressFamily : IPv4
@arton
arton / binsearch.coffee
Last active August 4, 2018 17:21
binary search for Coffee
binsearch = (a, low, high, target) ->
if low == high || low + 1 == high
if a[low] < target then return low + 1 else return low
mid = Math.floor((low + high) / 2)
if a[mid] == target
return mid
else if target > a[mid]
binsearch(a, mid + 1, high, target)
else
binsearch(a, low, mid - 1, target)
require 'origami'
pdf = Origami::PDF.read(ARGV[0], verbosity: Origami::Parser::VERBOSE_QUIET)
unless pdf.pages.first.Resources.Font.C2_0
exit 1
end
font_table = {}
pdf.pages.first.Resources.each_font do |name, font|
puts name if $DEBUG
@arton
arton / gist:39662998a7a5582ceab6f36a6502128f
Last active April 1, 2024 04:20
dropdown list by fast_excel
module Libxlsxwriter
class Validator < FFI::Struct
layout :validate, :uint8,
:criteria, :uint8,
:ignore_blank, :uint8,
:show_input, :uint8,
:show_error, :uint8,
:dropdown, :uint8,
:value_number, :double,
:value_formula, :string,