Skip to content

Instantly share code, notes, and snippets.

@t9md
t9md / USAGE.md
Last active February 1, 2019 06:33
extract field since awk is very awkward for me.

help

$ ruby extract-fields.rb -h
Usage: extract-fields [options]
    -r, --report                     Report field configuration from very 1st line. (default: false)
    -s, --split VALUE                string value (default: "\t")
    -j, --join VALUE                 string value (default: "\t")
    -f, --fields one,two,three       fields to extract (default: [])
# -*- coding: utf-8 -*-
import sys
import os
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
def save_snapshot(driver, word):
fname = 'imgs/%s.png' % word
@t9md
t9md / atom.js
Created September 12, 2018 01:00
// get tree sitter supported grammar
atom.grammars.treeSitterGrammarsById
@t9md
t9md / keymap.cson
Created April 11, 2018 14:49
recover original ctrl-c on win when using with vim-mode-plus.
'atom-text-editor':
'ctrl-c': 'core:copy'
$hosts_table = {
:dbm => "192.168.86.101",
:app1 => "192.168.86.102",
:app2 => "192.168.86.103",
:lb => "192.168.86.104",
}
def bootstrap(config, host)
config.vm.box = "lucid64"
config.vm.network $hosts_table[host]
@t9md
t9md / bookmarks.js
Created February 24, 2018 17:35
narrow-bookmarks provider
const {Range} = require('atom')
const Provider = require('./provider')
const {compareByPoint} = require('../utils')
const Config = {
showProjectHeader: true,
showFileHeader: true
}
// HACK: Core bookmarks package

To mafke tab confirm 2nd complete candidates.

  • init.js
atom.commands.add("atom-text-editor", "user:autocomplete-plus-select-next-and-confirm", function() {
  const editor = this.getModel()
  atom.commands.dispatch(editor.element, "core:move-down")
 atom.commands.dispatch(editor.element, "autocomplete-plus:confirm")
renderItems () {
if (this.items.length > 0) {
const className = ['list-group'].concat(this.props.itemsClassList || []).join(' ')
if (this.observer) {
etch.getScheduler().getNextUpdatePromise().then(() => {
const elements = Array.from(this.refs.items.children)
// Use initially rendered last item's height as height of all fake item
// Refering 1st item is bad idea, since 1st item tend to be rendered differently.
atomic-chrome: 0.3.0
choose-pane: 0.8.0
clip-history: 0.4.0
cursor-history: 0.12.0
demo-mode: 0.4.1
dev: 0.0.0
duotone-dark-sea-syntax: 2.1.0
markdown-toc-auto: 0.8.0
mprettier: 0.1.2
narrow: 0.53.2
@t9md
t9md / config.cson
Created November 24, 2017 04:18
submode perfect gt
submode:
submode:
"gt-mode":
target: "atom-pane"
commands: [
"pane:show-next-item"
"pane:show-previous-item"
]