Skip to content

Instantly share code, notes, and snippets.

View KMR-zoar's full-sized avatar

Zoar KMR-zoar

  • Kawagoe, Japan
View GitHub Profile
@KMR-zoar
KMR-zoar / law.js
Created March 28, 2019 08:20
simpleMatch for Brackets
import CodeMirror from 'codemirror'
CodeMirror.defineMode('law', () => {
return {
token: (stream, state) => {
const inBrackets = stream.match(/(.*?)/)
if (inBrackets) {
return 'keyword'
}
stream.next()
@KMR-zoar
KMR-zoar / app.js
Last active March 1, 2019 06:32
Remove layers added by ol-geocoder seach
function remove_search_marker() {
var remove_layer_name = 'geocoder-layer';
var layers_to_remove = [];
map.getLayers().forEach(function(layer) {
var layer_name = layer.getProperties().name;
if (layer_name && layer_name.match(remove_layer_name)) {
layers_to_remove.push(layer);
}
});
let
filePath = "?????.geojson",
source = Json.Document(File.Contents(filePath)),
converted2Table = Record.ToTable(source),
features = converted2Table{5}[Value],
fearure2table = Table.FromList(
features, Splitter.SplitByNothing(), null, null, ExtraValues.Error
),
expandedColumn1 = Table.ExpandRecordColumn(
fearure2table, "Column1", {
[param]
east = "137.500,20.455,153.987,45.558"
center = "129.587,20.455,137.945,37.910"
west = "122.933,20.455,129.815,34.780"
[osm]
api = "https://www.openstreetmap.org/history/feed"
[rgeocode]
api = 'http://www.finds.jp/ws/rgeocode.php'
@KMR-zoar
KMR-zoar / bookmarklet.js
Created September 28, 2018 07:49
Open changeset on the chageset-map from osmlab
javascript:(function(){if(location.hostname==='www.openstreetmap.org'&&location.pathname.slice(1,10)==='changeset'){window.open('https://osmlab.github.io/changeset-map/#'+location.pathname.slice(location.pathname.lastIndexOf('/')+1));void(0)}else{window.alert('It is not OSM changeset URL')}})();
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/mode/markdown/markdown.min.js"></script>
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[00;36m\]\w\[\033[00m\]\$ '
else
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>TimeTable</title>
<link rel="stylesheet" href="tablestyle.css">
</head>
<body>
@KMR-zoar
KMR-zoar / index.html
Created March 23, 2018 02:01
Vue.js 入門
<!DOCTYPE html>
<html lang="ja">
<head>
<!--
Vue.js 入門: http://www.tohoho-web.com/ex/vuejs.html
-->
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue Test</title>
@KMR-zoar
KMR-zoar / images-update-for-docker.sh
Last active March 14, 2018 03:05
docker images Refresh
#!/bin/bash
docker images | grep latest | awk '{print $1}' | xargs -IXX docker pull XX
dangling=`docker images -f dangling=true -q | wc -l`
if [ $dangling != '0' ]
then
docker images -f dangling=true -q | xargs docker rmi
fi