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
<html> | |
<head> | |
<link rel="stylesheet" type="text/css" href="http://extjs-public.googlecode.com/svn/extjs-4.x/release/resources/css/ext-all.css" /> | |
<script type="text/javascript" src="http://extjs-public.googlecode.com/svn/extjs-4.x/include/ext-all.js"></script> | |
<script type="text/javascript"> | |
Ext.onReady(function(){ | |
var touchInf = {}; | |
Ext.getDom("panel").addEventListener("touchstart",function(e){ | |
for(var c = 0; c < e.changedTouches.length; c++){ |
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
// https://overpass-turbo.eu/ | |
// 上記のURLに行ってこのコードをペーストし、地図でBBOXを指定し、実行する。 | |
[out:json]; | |
way["highway"]({{bbox}}); | |
foreach((._;>;);out;); |
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
//Generate Encoded Polyline Algorithm Format for Google Static Maps API | |
// http://bit.ly/sw3deL (Japanese) | |
// http://bit.ly/tnKt4m (English) | |
function encodeGPolyline(path){ | |
var enc = ""; | |
var old = true; | |
for(c in path){ | |
var latlng = path[c]; | |
if(old === true){ |
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 int ledPin = 7; | |
const int speakerPin = 9; | |
void setup() { | |
pinMode(2, INPUT_PULLUP); | |
pinMode(7, OUTPUT); | |
pinMode(9, OUTPUT); | |
attachInterrupt(0, speaker, FALLING); | |
} |
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
Promise.all( | |
["workspace.xml", "toolbox.xml"].map(async file => { | |
return fetch(file).then( | |
(res) => { | |
return res.text(); | |
} | |
); | |
}) | |
).then((xmls) => { | |
xmls.forEach((xml) => { |
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
<?php | |
//Generate Encoded Polyline Algorithm Format for Google Static Maps API | |
// http://bit.ly/sw3deL (Japanese) | |
// http://bit.ly/tnKt4m (English) | |
function encodeGPolyline($path){ | |
$enc = ""; | |
$old = true; | |
foreach($path as $latlng){ | |
if($old === true){ |
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
// prettified version of what can be found here: | |
// https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_subsequence#JavaScript | |
function LCS(a, b) { | |
var m = a.length, | |
n = b.length, | |
C = [], | |
i, | |
j; | |
for (i = 0; i <= m; i++) C.push([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
//Parameter K | |
var k = 30; | |
//need async and flickr lib | |
// npm install async | |
// npm install flickrapi | |
/* Internal Arguments for the algorithm A | |
var c = {}; | |
var n = 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
#!/usr/local/bin/node | |
var conn = []; | |
// https://github.com/Worlize/WebSocket-Node/wiki/Documentation | |
var WebSocketServer = require('websocket').server; | |
var http = require('http'); | |
var originIsAllowed = function(){return true;} | |
var server = http.createServer(function(request, response) { | |
console.log((new Date()) + " Received request for " + request.url); | |
response.writeHead(404); | |
response.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
sudo vim /root/credentials_nas.txt | |
#書き込む内容は下のcredentials_nas.txtを参照せよ | |
#作成終わったらパーミッションをrootのみに限定する | |
sudo chown root:toot /root/credentials_nas.txt | |
sudo chmod 600 /root/credentials_nas.txt |
NewerOlder