Skip to content

Instantly share code, notes, and snippets.

@memorycraft
memorycraft / gist:1232547
Created September 21, 2011 16:29
移行チェックB
mysql> select * from gift order by id;
+------+----------------------------------+----------------------------------+---------------------+
| id | name | description | created_at |
+------+----------------------------------+----------------------------------+---------------------+
| 1 | d84c7d13d56e48999f6e42396bb0d6b8 | 57b6f87681df4141953b63cd6ee74... | 2011-09-21 22:35:23 |
| 3 | 936917c0e7b246b380573654c80863e1 | 08cf01342f1149b5a7fa15f2df5b6... | 2011-09-21 22:35:24 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 5429 | 0462eaf7646b4855a993a49128ba3f4d | 0d07cdbac3c14723b25bc1a1bc74a... | 2011-09-22 01:07:42 |
| 5431 | 431a0be6d0d94223bad8405d0011560e | f78b63b0ed5c42d0a947dc3db6bcb... | 2011-09-22 01:07:56 |
+------+----------------------------------+----------------------------------+---------------------+
@memorycraft
memorycraft / gist:1232552
Created September 21, 2011 16:29
移行チェックC
mysql> select * from gift order by id;
+------+----------------------------------+----------------------------------+---------------------+
| id | name | description | created_at |
+------+----------------------------------+----------------------------------+---------------------+
| 2 | fc52fbdee1904e40a92711bc3ff5b53b | 4fe1116428e142369ab419d603a8b... | 2011-09-21 22:35:23 |
| 4 | 5d630544409e4ef98ece5b489cd5aff5 | c3c1848832d04b69bc9f9c1bd7249... | 2011-09-21 22:35:23 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| 5430 | b67fdb0b633c40829dd812c0358f5ccb | 85a310e34668427ab392b07fe36f8... | 2011-09-22 01:07:49 |
| 5432 | 4a0f9c4dcbaa42a99aeb014232091551 | 9ceb2dce039e49268280560631578... | 2011-09-22 01:08:02 |
+------+----------------------------------+----------------------------------+---------------------+
@memorycraft
memorycraft / index.html
Created November 9, 2011 20:58
awsplug - index.html
<html>
<head>
<title>awsplug</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<style type="text/css">
#stage{
padding: 20px;
}
.component {
opacity:0.8;
@memorycraft
memorycraft / gist:4336781
Created December 19, 2012 13:49
SNSのHTTP NotificationでSubscription Confirm
public function action_alert()
{
/*
$sns = new AmazonSNS(array('key'=>'xxxxxxxxxxxxxxxxxx',
'secret'=>'xxxxxxxxxxxxxxxxxxxx'));
$sns->set_region(AmazonSNS::REGION_APAC_NE1);
$input = file_get_contents('php://input');
$input =json_decode($input, true);
@memorycraft
memorycraft / gist:4445989
Created January 3, 2013 18:59
CSSだけでジーニーエフェクト
ul.the-icons li{
height: 30px;
}
ul.the-icons li i{
float: left;
width: 30px;
height: 24px;
vertical-align: center;
text-align: center;
-webkit-transition: all 250ms ease;
@memorycraft
memorycraft / gist:4730160
Created February 7, 2013 10:36
elb*socket.io - index.html
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
var hostname = location.hostname;
$.ajaxSetup({cache: true});
$(function(){
function load(){
$.getScript("/assets/js/client.js");
var io = require('socket.io').listen(3000);
var RedisStore = require('socket.io/lib/stores/redis');
opts = {host:'xxx.xxx.xxx.xxx', port:6379};
io.set('store', new RedisStore({redisPub:opts, redisSub:opts, redisClient:opts}));
io.sockets.on('connection', function (socket) {
socket.emit('info', { msg: 'welcome' });
socket.on('msg', function (msg) {
io.sockets.emit('msg', {msg: msg});
$(function(){
var socket = io.connect('http://'+location.hostname+':3000/');
socket.on('connect', function(){
$("#log").html($("#log").html() + "<br />" + (new Date()).toLocaleString()+ 'connected');
});
socket.on('disconnect', function(){
$("#log").html($("#log").html() + "<br />" + (new Date()).toLocaleString()+'disconnected');
});
socket.on('info', function (data) {
var io = require('socket.io').listen(3000);
io.sockets.on('connection', function (socket) {
socket.emit('info', { msg: 'welcome' });
socket.on('msg', function (msg) {
io.sockets.emit('msg', {msg: msg});
});
socket.on('disconnect', function(){
socket.emit('info', {msg: 'bye'});
});
#!/bin/sh
/etc/cloud/cassandra.sh 1111111111111 true