Skip to content

Instantly share code, notes, and snippets.

@pxsta
pxsta / tmux-highlight-text-patch-LICENSE
Last active September 29, 2023 05:20
tmux-highlight-text.patch enables tmux to highlight the text like iTerm2.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@pxsta
pxsta / BF4Playtime.rb
Created February 2, 2015 08:22
BF4の各月ごとのプレイ時間を取得する
#BF4の各月ごとのプレイ時間を取得する
require 'bundler'
Bundler.require
EMAIL=''
PASSWORD=''
USER_ID='' #http://battlelog.battlefield.com/bf4/soldier/#{USER_NAME}/stats/#{USER_ID}/pc/の#{USER_ID}部分の数値
#ログインしてCookieを取得する
res=RestClient.post('https://battlelog.battlefield.com:443/bf4/gate/login/',{:email=>EMAIL,:password=>PASSWORD,:submit=>'Log+in',:redirect=>''}) do |response, request, result, &block|
@pxsta
pxsta / ArduinoRoomdoor.ino
Last active June 6, 2017 02:02
Arduinoで扉の開閉監視する
void setup() {
Serial.begin(9600) ;
pinMode(13, OUTPUT);
pinMode(2, INPUT_PULLUP);
}
unsigned long prev=0;
void loop() {
int x;
unsigned long current = millis();
@pxsta
pxsta / app.js
Created October 28, 2012 08:30
mochaとsuperagentを用いてexpressのアプリのセッション周りのテスト
"use strict";
var express = require('express')
, http = require('http')
, path = require('path')
, io = require('socket.io')
, connect = require("express/node_modules/connect")
, Session = express.session.Session
, app = module.exports = express();
//メモリストアかRedisのどちらかでセッションを保存
@pxsta
pxsta / app.js
Created October 22, 2012 14:44
Socket.io-Express3.x-session
"use strict";
var express = require('express')
, http = require('http')
, path = require('path')
, io = require('socket.io')
, connect = require("express/node_modules/connect")
, Session = express.session.Session
, app = express();
//メモリストアかRedisのどちらかでセッションを保存