Skip to content

Instantly share code, notes, and snippets.

@yoggy
yoggy / surfacepro3-keyboard-jp-settings.reg
Created February 28, 2015 08:46
Surface Pro 3でソフトウェアキーボードで日本語キーボードが表示されないのを修正するregファイル
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\i8042prt\Parameters]
"LayerDriver JPN"="kbd106.dll"
"OverrideKeyboardType"=dword:00000007
"OverrideKeyboardIdentifier"="PCAT_106KEY"
"OverrideKeyboardSubtype"=dword:00000002
//
// serial_sseg.ino - serial display control sketch for 7segduino
//
// github:
// https://gist.github.com/yoggy/80e47ff0932f3900c77f
//
// license:
// Copyright (c) 2015 yoggy <[email protected]>
// Released under the MIT license
// http://opensource.org/licenses/mit-license.php
package main
import (
"fmt"
"net/http"
)
func testHandler(w http.ResponseWriter, req *http.Request) {
fmt.Fprintln(w, "/test handler")
}
package main
import (
"fmt"
"net"
)
func main() {
conn, err := net.Dial("tcp", "127.0.0.1:7")
if err != nil {
@yoggy
yoggy / gist:f9cc7ab1dbe581cd2fe5
Created February 10, 2015 09:25
lsの結果をhtmlに出力するワンライナー?
$ ls * | (echo "<html><body>" ; sed -e 's/\(^.*$\)/\<a href=\"\1\"\>\1\<\/a\>/' ; echo "</body></html>")
@yoggy
yoggy / a lazy setting for debian & ubuntu.md
Last active August 29, 2015 14:14
テスト用Debian・Ubuntu環境の設定のメモ

テスト用Debian・Ubuntu環境の設定のメモ

VMなどで動作テスト用にLinux環境を頻繁に作っていると ユーザ&パスワードの設定をしょっちゅう忘れるので、 ユーザ&パスワードを入力しなくても一通り使える テスト用Debian・Ubuntu環境の設定のメモ。

パスワードを入力しなくてもいいように設定するのは次の2点

  • sudoをパスワードなしで使えるようにする。
  • 起動した直後にtty1が自動的ログインしている状態にする。
#
# mqtt publish sample
#
# $ gem install mqtt
# $ gem install pit
#
require 'rubygems'
require 'mqtt'
require 'json'
require 'pit'
#define __GLMETASEQ_C__
#include "GLMetaseq.h"
/*
GLMetaseq
The MIT License
Copyright (c) 2009 Sunao Hashimoto and Keisuke Konishi
//
// attiny85_1mhz_ir_38khz.ino
//
// see also... http://forum.arduino.cc/index.php?PHPSESSID=hvsfmjo2l66kv9g9rhaigftje4&topic=139729.msg1049431#msg1049431
//
void setFrequency(uint16_t freq)
{
uint32_t requiredDivisor = (F_CPU/2)/(uint32_t)freq;
uint16_t prescalerVal = 1;
Clock clock;
void setup() {
size(200, 200);
clock = new Clock(width / 2, height / 2, width/2-20);
}
void draw() {
background(0);
noFill();