Skip to content

Instantly share code, notes, and snippets.

View yyoshiki41's full-sized avatar
📻

Yoshiki Nakagawa yyoshiki41

📻
View GitHub Profile
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@koron
koron / shutdownable_server.go
Created October 5, 2017 15:47
Sample http.Server with Shutdown
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
# app
GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO app@'10.255.0.0/255.255.0.0' IDENTIFIED BY 'password'

# operator
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, REFERENCES ON *.* TO operator@'%' IDENTIFIED BY 'password'

# viewer
GRANT SELECT ON *.* TO viewer@'%' IDENTIFIED BY 'password'
@hikarock
hikarock / twitter-gas.js
Last active December 30, 2020 04:42
twitter-gas.js
var PROJECT_KEY = '';
var TWITTER_CONSUMER_KEY = '';
var TWITTER_CONSUMER_SECRET = '';
function trigger() {
search('東京オリンピック', 0);
}
function reset() {
var service = getService();

マージ済みのリモートブランチを全て削除

git branch -r --merged master | grep -v -e master -e develop | sed -e 's% *origin/%%' | xargs -I% git push --delete origin %
  1. remote の master に merge済み の branch をすべて表示して
  2. master と develop は消えてほしくないので除外して
  3. origin/ を削除して
  4. xargs (-I% % で ブランチ名を渡しつつ、全て削除する)
@yutori
yutori / redis_cluster.md
Last active April 20, 2019 23:17
Redis Cluster のリシャーディングとorphaned masterの話 - CyberAgent エンジニア Advent Calendar 2014 2日目

Redis Cluster のリシャーディングとorphaned masterの話

(2019/04 追記 こちらの情報は非常に古く、またRC版での結果となります。記録として残していますが参考になさらないでください

CyberAgent エンジニア Advent Calendar 2014 2日目です。

昨日に引き続き、秋葉原ラボの柿島が担当します。仕事ではHadoopクラスタの運用を中心に、秋葉原ラボのインフラ/ミドルウェアまわりを担当しています。今年はHadoop、mesos、Aerospikeと分散型のシステムを触る機会が多い1年でした。

この記事のテーマはRedis Clusterです。Redis Clusterが使えるようになるRedis 3.0.0は10月にRC1がリリースされました。2015年のQ1にstableリリースを目指しているようです。

#include <stdio.h>
#define N 1000
void initialize(long long int *r, long long int *s, long long int *y, long long int *x);
int
main(int argc, char* argv[])
{
// z: k + 1
@rtt
rtt / tinder-api-documentation.md
Last active June 21, 2024 04:19
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@matope
matope / base_an_acid_alternative.markdown
Created November 25, 2012 02:44
BASE: An Acid Alternative[和訳]
@matope
matope / Cassandra - A Decentralized Structured Storage System.markdown
Created July 23, 2012 09:56
Cassandra - A Decentralized Structured Storage System[和訳]