Skip to content

Instantly share code, notes, and snippets.

View 4noha's full-sized avatar

Shinonome.Hatsuri 4noha

View GitHub Profile
@4noha
4noha / kinntai_no_yatu.js
Last active February 16, 2017 00:32
node.jsでDashボタンによってアレしてPush Bulletに結果投げるやつ
const DashButton = require( 'dash-button' );
const Request = require( 'request' );
const Fs = require( 'fs' );
const Iconv = require( 'iconv-lite' );
const PushBullet = require( 'pushbullet' );
const D_BUTTON_MAC = 'xx:xx:xx:xx:xx:xx';
const EMPLOYEE_NO = 'にゃ〜ん';
const PASSWORD = 'にゃ〜ん';
const PUSH_ACCOUNT = 'にゃ〜ん';
@4noha
4noha / kinntai_no_yatu2.js
Last active June 1, 2017 09:58
https://gist.github.com/nokkii/b04c399a83437b714e0f280fb30e6416 をhttpクライアントで複数台設定できるやつ
const DashButton = require( 'dash-button' );
const Request = require( 'request' );
const Fs = require( 'fs' );
const Iconv = require( 'iconv-lite' );
const PushBullet = require( 'pushbullet' );
const Mysql = require('mysql');
const Http = require('http');
const Querystring = require('querystring');
const MYSQL_HOST = 'にゃ〜ん';
const DashButton = require( 'dash-button' );
const Request = require( 'request' );
const D_BUTTON_MAC = 'xx:xx:xx:xx:xx:xx';
let button = new DashButton( D_BUTTON_MAC );
let subscription = button.addListener( () => {
/*
var cTime = new Date();
var options;
@4noha
4noha / Confluence Party Header
Last active June 9, 2017 04:30
コンフルのHTMLブロックプラギンに入れるとヘッダがスクロールイベントにに反応してパリピ仕様になる
<script type="text/javascript">
$(function(){
$(window).scroll(function () {
// 16777216 = 0xFFFFFF + 1
var rgb = Math.floor( Math.random() * 16777216 ).toString( 16 );
zerofill = 6 - rgb.length;
for ( ; zerofill > 0; zerofill-- ) {
rgb = '0' + rgb;
}
@4noha
4noha / now_playing.js
Created June 23, 2017 06:56
[WIP] slackにNow Playingするやつ(Mac用)。アクセストークンの差異で発言元をbotと自アカウント(未実装)で選べる。
/******************************************************************************
**
** now_playing.js
** Created by Takuya Noaki on 17/06/19.
**
** 使い方1: osascript -l JavaScript now_playing.js ユーザ名
** 使い方2: slackAccessTokenに自分のアクセストークンを設定(未実装)
** osascript -l JavaScript now_playing.js
**
******************************************************************************/
@4noha
4noha / now_playing.wsf
Created June 23, 2017 06:59
[WIP] slackにNow Playingするやつ(Win用)。アクセストークンの差異で発言元をbotと自アカウント(未実装)で選べる。
<?xml version="1.0" encoding="utf-8" ?>
<package>
<job>
<runtime></runtime>
<script language="JScript">
<![CDATA[
/******************************************************************************
**
** now_playing_win.wsf
** Created by Takuya Noaki on 17/06/20.
@4noha
4noha / Confluence Bote System.html
Last active June 30, 2017 09:17
ConfluenceでHTMLコードブロックと変数用の記事を使って投票ページを作るやつ
<table id="vote_system">
<thead>
<tr>
<th>名前</th>
<th>得票数</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody></tbody>
@4noha
4noha / rename_user.sh
Last active May 1, 2019 20:24
Raspbian rename default user
ssh [email protected]
> raspberry
sudo apt-get update
> raspberry
sudo apt-get upgrade
sudo useradd -M tmp
sudo gpasswd -a tmp sudo
sudo passwd tmp
> a
@4noha
4noha / create_ap.sh
Created December 10, 2017 11:47
Create RaspberryPi WiFi AP bridge
ssh [email protected]
> raspberry
sudo apt-get install bridge-utils -y --no-install-recommends
> raspberry
sudo emacs /etc/network/interfaces
"
auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
"
#include <WiFi.h>
// Replace with your network credentials
const char* ssid = "your SSID";
const char* password = "your PASS";
WiFiServer server(80);
const int heat = 13;
const int cooldown = 12;