Skip to content

Instantly share code, notes, and snippets.

View nulltask's full-sized avatar

Seiya KONNO nulltask

View GitHub Profile
<!doctype html>
<html>
<body>
<form name="open">
<input type="text" name="id" placeholder="id"> <input type="submit" value="open">
</form>
<form name="close">
<input type="text" name="id" placeholder="id"> <input type="submit" value="close">
</form>
<script src="/socket.io/socket.io.js"></script>
@nulltask
nulltask / index.js
Last active August 29, 2015 14:07
simple queue library
/**
* Module dependencies.
*/
var assert = require('assert');
var Emitter = require('events').EventEmitter;
var Batch = require('batch');
var Backoff = require('backo');
pry(main)> RGeo::Geos.constants
[
[ 0] :Utils,
[ 1] :CAPI_SUPPORTED,
[ 2] :FFIGeometryMethods,
[ 3] :FFIPointMethods,
[ 4] :FFILineStringMethods,
[ 5] :FFILinearRingMethods,
[ 6] :FFILineMethods,
[ 7] :FFIPolygonMethods,
> select * from pg_available_extensions;
name | default_version | installed_version | comment
------------------------+-----------------+-------------------+---------------------------------------------------------------------
postgis_tiger_geocoder | 2.1.0 | | PostGIS tiger geocoder and reverse geocoder
pg_trgm | 1.1 | | text similarity measurement and index searching based on trigrams
uuid-ossp | 1.0 | | generate universally unique identifiers (UUIDs)
postgres_fdw | 1.0 | | foreign-data wrapper for remote PostgreSQL servers
intagg | 1.0 | | integer aggregator and enumerator (obsolete)
chkpass | 1.0 | | data type for auto-encrypted passwords
tablefunc | 1.0
Built-in Atom packages (77)
├── archive-view@0.36.0
├── atom-dark-syntax@0.19.0
├── atom-dark-ui@0.34.0
├── atom-light-syntax@0.20.0
├── atom-light-ui@0.29.0
├── autocomplete@0.31.0
├── autoflow@0.18.0
├── autosave@0.15.0
├── background-tips@0.16.0
@nulltask
nulltask / 20140826.md
Last active September 13, 2020 09:08
Express / Socket.IO をスケールアウトしてみよう
var ioc = require('socket.io-client');
var timers = [];
var clients = [];
var client = require('node-serf').connect({ port: 7373 }, function() {
client.stream({ Type: 'user:socket.io' }, function(res) {
console.log(require('util').inspect(res));
try {
var payload = JSON.parse(res.Payload);
var AWS = require('aws-sdk');
AWS.config.update({
logger: process.stdout,
region: 'ap-northeast-1'
});
var r53 = new AWS.Route53();
var params = {
var io = require('socket.io-client');
var connection = process.env.LATENCY_CONNECTION || 100;
var host = process.env.LATENCY_HOST || 'ws://localhost:3000';
var options = {
forceNew: true
};
for (var i = 0; i < connection; i++) {
(function() {
var timerId;
float xoff = 0.0;
float yoff = 0.0;
void setup() {
size(600, 600);
}
void draw() {
noStroke();