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 https = require('https'); | |
const postSlack = (rec)=>{ | |
return new Promise((resolve, reject)=>{ | |
const path = rec.ecs_cluster.match(/staging/) ? process.env.STAGING_SLACK_PATH : process.env.PRODUCTION_SLACK_PATH; | |
const data = JSON.stringify({ text: JSON.stringify(rec) }); | |
const options = { | |
hostname: 'hooks.slack.com', | |
port: 443, | |
path, |
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
/* | |
For processing data sent to Firehose by Cloudwatch Logs subscription filters. | |
Cloudwatch Logs sends to Firehose records that look like this: | |
{ | |
"messageType": "DATA_MESSAGE", | |
"owner": "123456789012", | |
"logGroup": "log_group_name", | |
"logStream": "log_stream_name", |
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
/* | |
For processing data sent to Firehose by Cloudwatch Logs subscription filters. | |
Cloudwatch Logs sends to Firehose records that look like this: | |
{ | |
"messageType": "DATA_MESSAGE", | |
"owner": "123456789012", | |
"logGroup": "log_group_name", | |
"logStream": "log_stream_name", |
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
import { Actions, AppState } from "./reducers/index"; | |
import { useReducer, useMemo, useRef, useEffect } from "react"; | |
import withPromise from "./withPromise"; | |
const groupStart = | |
process.env.NODE_ENV !== "production" | |
? (val: string) => { | |
console.groupCollapsed("Action Type:", val); | |
} | |
: (val: string) => {}; |
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/ruby | |
if ARGV.length != 1 | |
puts "#{$0} outputfile" | |
exit -1 | |
end | |
unless file = File.open(ARGV[0],"wb") | |
puts "#{$0} outputfile" | |
puts "#{ARGV[0]} can't write" | |
exit -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
{ | |
"editor.minimap.enabled": false, | |
"editor.formatOnSave": true, | |
"tslint.alwaysShowRuleFailuresAsWarnings": true, | |
"window.zoomLevel": 2, | |
"explorer.confirmDelete": false, | |
"files.trimTrailingWhitespace": true, | |
"files.eol": "\n", | |
"typescript.updateImportsOnFileMove.enabled": "always" | |
} |
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
function! <SID>StripTrailingWhitespaces() | |
let l = line(".") | |
let c = col(".") | |
%s/\s\+$//e | |
call cursor(l, c) | |
endfun | |
autocmd BufWritePre *.ts,*.rb,*.tsx,*.js,*.erb :call <SID>StripTrailingWhitespaces() |
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 'nkf' | |
raw = File.read("#{ENV['HOME']}/Downloads/EIJIRO-1445.TXT") | |
data = NKF.nkf("-w -d", raw) | |
results = {} | |
first_flg = false | |
data.each_line do |raw_line| | |
next if !first_flg && !raw_line.match(/a\s+{不-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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'mysql' | |
require 'optparse' | |
options = { | |
:database => '', | |
:host=> 'localhost', | |
:create=> false, | |
:count=> false, | |
:index=> false, |
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
function! ReadFile() abort | |
let s:currentPos = col('.') | |
let s:colNum = s:currentPos - 1 | |
let s:lastPos = len(getline('.')) | |
let s:fileName = '' | |
let s:ext = '.' . expand("%:e") | |
while s:colNum > -1 | |
if getline('.')[s:colNum] =~ "\['\"\]" | |
break | |
end |
NewerOlder