Skip to content

Instantly share code, notes, and snippets.

View eargasm_explosion.applescript
tell application "iTunes"
activate
set newPreset to make new EQ preset
set name of newPreset to "Eargasm Explosion"
set band 1 of newPreset to 3
set band 2 of newPreset to 6
set band 3 of newPreset to 9
set band 4 of newPreset to 7
set band 5 of newPreset to 6
set band 6 of newPreset to 5
View perfect.applescript
tell application "iTunes"
activate
set newPreset to make new EQ preset
set name of newPreset to "Perfect"
set band 1 of newPreset to 3
set band 2 of newPreset to 6
set band 3 of newPreset to 9
set band 4 of newPreset to 7
set band 5 of newPreset to 6
set band 6 of newPreset to 5
@laclefyoshi
laclefyoshi / test_featurefu_snippet.java
Last active Sep 6, 2015
FeatureFuを使ってみた
View test_featurefu_snippet.java
// https://github.com/laclefyoshi/test_featurefu/blob/master/src/test/java/org/saekiyoshiyasu/OperationTest.java
// assertEquals(expected, actual, delta)
assertEquals(evaluator("(== a b)", 1.2, 1.3), 0.0, 0); // false == 0.0
assertEquals(evaluator("(== a b)", 2.5, 2.5), 1.0, 0); // true == 1.0
assertEquals(evaluator("(!= a b)", 1.2, 1.3), 1.0, 0);
assertEquals(evaluator("(> a b)", 1.3, 1.3), 0.0, 0);
assertEquals(evaluator("(< a b)", 2.3, 2.5), 1.0, 0);
assertEquals(evaluator("(>= a b)", 1.3, 1.3), 1.0, 0);
assertEquals(evaluator("(<= a b)", 2.3, 2.5), 1.0, 0);
assertEquals(evaluator("(max a b)", 1.2, 1.3), 1.3, 0);
@laclefyoshi
laclefyoshi / langtool-popup.el
Created Sep 12, 2015
langtool.elをpopup.elに対応
View langtool-popup.el
(defun popup-current-langtool-error ()
(interactive)
(let ((msgs (langtool--current-error-messages)))
(if (null msgs)
(popup-tip "No errors")
(let ((msg (split-string (car msgs) "\n")))
(popup-tip (join "\n" (reverse (nthcdr 2 (reverse msg)))))))))
(global-set-key "\C-ce" 'popup-current-langtool-error)
@laclefyoshi
laclefyoshi / translator.hs
Created Oct 16, 2010
A Command-line Tool for Google Translate
View translator.hs
-- A Command-line Tool for Google Translate
-- Copyright : (c) SAEKI Yoshiyasu
-- License : MIT-style license <http://www.opensource.org/licenses/mit-license.php>
-- last updated: 2010/10/16
import Network.URI
import Data.List
import Network.HTTP
import Text.JSON
import System
@laclefyoshi
laclefyoshi / websocket_devicemotion_ios.html
Created Nov 26, 2010
WebSocket and DeviceMotion Event for iOS Safari
View websocket_devicemotion_ios.html
<!DOCTYPE html>
<html lang="jp" xml:lang="jp">
<head>
<meta charset="utf-8">
<title>Balls</title>
<style>
.ball {
position: absolute;
top: 0px;
left: 0px;
@laclefyoshi
laclefyoshi / websocket_server.py
Created Nov 26, 2010
WebSocket server with Tornado
View websocket_server.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright : (c) SAEKI Yoshiyasu
# License : MIT-style license
# <http://www.opensource.org/licenses/mit-license.php>
# last updated: 2010/11/25
import tornado.httpserver
import tornado.ioloop
import tornado.web
@laclefyoshi
laclefyoshi / balls_canvas.html
Created Dec 4, 2010
Web page using WebSocket and DeviceMotion Event
View balls_canvas.html
<!DOCTYPE html>
<html lang="jp" xml:lang="jp">
<head>
<meta charset="utf-8">
<title>Balls</title>
<style>
.ball {
position: absolute;
top: 0px;
left: 0px;
@laclefyoshi
laclefyoshi / balls_websocket.py
Created Dec 4, 2010
WebSocket Server for connecting iPod touch and Arduino
View balls_websocket.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright : (c) SAEKI Yoshiyasu
# License : MIT-style license
# <http://www.opensource.org/licenses/mit-license.php>
# last updated: 2010/12/03
import tornado.httpserver
import tornado.ioloop
import tornado.web