Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
laclefyoshi / gist:8627514
Created January 26, 2014 02:43
Google Chrome voices
> var msg = new SpeechSynthesisUtterance()
undefined
> msg
SpeechSynthesisUtterance {onboundary: null, onmark: null, onresume: null, onpause: null, onerror: null…}
lang: ""
onboundary: null
onend: null
onerror: null
onmark: null
$ ./scalastyle.sh Documents/Projects/scala/URLHandle.scala
/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala:45:2:warning: Whitespace at end of line
/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala:35:16:warning: Avoid using null
/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala:47:3:warning: Regular expression matched 'println'
/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala:55:3:warning: Regular expression matched 'println'
/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala:14:15:warning: Public method must have explicit type
/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala:32:15:warning: Public method must have explicit type
(defun flymake-scalastyle-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "~/.local/bin/scalastyle.sh" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.scala\\'" flymake-scalastyle-init))
(add-hook 'scala-mode-hook
#!/bin/sh
java -jar ~/.local/src/scalastyle-batch_2.10-0.3.2/scalastyle-batch_2.10.jar \
--config ~/.local/src/scalastyle-batch_2.10-0.3.2/scalastyle_config.xml "$1" \
| python -c \
'import re
format = re.compile(r"^(\S+) +file=(.+?) +message=(.+?) +line=(\d+) +column=(\d+)$")
while True:
s = ""
try:
$ java -jar ~/.local/src/scalastyle-batch_2.10-0.3.2/scalastyle-batch_2.10.jar \
--config ~/.local/src/scalastyle-batch_2.10-0.3.2/scalastyle_config.xml \
Documents/Projects/scala/URLHandle.scala
warning file=/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala message=Header does not match expected text line=1
warning file=/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala message=Whitespace at end of line line=46 column=2
warning file=/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala message=Avoid using null line=36 column=16
warning file=/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala message=Regular expression matched 'println' line=48 column=3
warning file=/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala message=Regular expression matched 'println' line=56 column=3
warning file=/Volumes/Macintosh HD/Users/yoshiyasu/Documents/Projects/scala/URLHandle.scala mes
@laclefyoshi
laclefyoshi / configuration.xml
Last active December 23, 2015 15:39
oozie workflow.xml for using scalding as Java Action
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property>
<name>jobTracker</name>
<value>master.saekiyoshiyasu.org:8021</value>
</property>
<property>
<name>nameNode</name>
<value>hdfs://master.saekiyoshiyasu.org:8020</value>
</property>
@laclefyoshi
laclefyoshi / App.java
Created May 25, 2013 07:30
hosebird_kafka java code
package hosebird_kafka;
import com.twitter.hbc.ClientBuilder;
import com.twitter.hbc.core.Constants;
import com.twitter.hbc.core.endpoint.StatusesSampleEndpoint;
import com.twitter.hbc.core.processor.StringDelimitedProcessor;
import com.twitter.hbc.httpclient.BasicClient;
import com.twitter.hbc.httpclient.auth.Authentication;
import com.twitter.hbc.httpclient.auth.OAuth1;
import kafka.javaapi.producer.Producer;
@laclefyoshi
laclefyoshi / pom.xml
Created May 25, 2013 07:29
pom.xml for hosebird_kafka
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>hosebird_kafka</groupId>
<artifactId>hosebird_kafka</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>hosebird_kafka</name>
int focusPin = 2;
int shutterPin = 3;
void setup() {
pinMode(focusPin, OUTPUT);
pinMode(shutterPin, OUTPUT);
pinMode(13, OUTPUT);
}
@laclefyoshi
laclefyoshi / esp8266_mqtt_sub.ino
Last active October 17, 2015 13:18
ESP8266でMQTTブローカを経由したmyThingsメッセージを受け取る
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <aJSON.h>
const char* ssid = "WIFI_SSID";
const char* password = "WIFI_PASS";
const char* mqtt_server = "MESHBLU";
const char* mqtt_clientid = "esp8266";
const char* mqtt_topic = "MESHBLU_ACTION_UUID";