- src/
- app-name/
- infra/
- terraform/
- main.tf
- terraform/
- provisiosing
- ansible.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/questions/3400915/how-do-i-round-an-integer-up-to-nearest-large-number-in-ruby | |
def round_up_10th(n) | |
d = 10 ** Math.log10(n).floor | |
q, r = n.divmod(d) | |
m = r.zero? ? q : q.succ | |
d * m | |
end | |
def round_up_2nd(n) | |
d = 2 ** Math.log2(n).floor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make abbreviation | |
def a10n(s) | |
n = s.size | |
if n < 2 | |
s | |
else | |
a, z = s[0], s[-1] | |
"#{a}#{n-2}#{z}" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.documentMode && document.documentMode < 11 && alert("Browser below IE11 is unsupported."); | |
document.documentMode || console.log("No more IE."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const iota = (n = 0) => Array(n).fill().map((_, i) => i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const domId = "productDetailsTable"; | |
const asinMatcher = /(?:ASIN:\s*)(\w+)/; | |
const detail = document.getElementById(domId); | |
const asin = detail.innerText.match(asinMatcher)[1]; | |
location.href = location.origin + "/dp/" + asin; | |
// oneline | |
(()=>{location.href = location.origin + "/dp/" + document.getElementById("productDetailsTable").innerText.match(/(?:ASIN:\s*)(\w+)/)[1];})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA SilentlyContinue | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- //LayoutList --> | |
<layout> | |
<configItem> | |
<name>oea</name> | |
<shortDescription>en</shortDescription> | |
<description>OEA layout</description> | |
<languageList> | |
<iso639Id>eng</iso639Id> | |
<iso639Id>jpn</iso639Id> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defined in - @ line 0 | |
function arg --description 'alias arg xargs -n 1' | |
xargs -n 1 $argv; | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'socket' | |
require 'netaddr' | |
interface = $*.first | |
ifaddr = Socket.getifaddrs.find { |i| i.name =~ /#{Regexp.quote(interface)}/ && i.addr.ipv4? } | |
ip, mask = ifaddr.addr.ip_address, ifaddr.netmask.ip_address |