This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
from itertools import groupby, product, compress, chain | |
from collections import Counter | |
INPUT = [ | |
# photo_id, tag_id | |
[1, "A"], | |
[1, "B"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.hkusu.realmtodoapp; | |
import android.os.Handler; | |
import android.os.HandlerThread; | |
import java.util.List; | |
import de.greenrobot.event.EventBus; | |
import io.realm.Realm; | |
import io.realm.RealmResults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://qiita.com/u-minor/items/e0e30655168dadf2b10e | |
# Arg1: file path of coverage report. | |
# Arg2: report parser shell script path. | |
# export COVERAGE_DIR=.coverage | |
# export SLACK_ENDPOINT=https://<YOUR_SLACK_TEAM_DOMAIN>.slack.com/services/hooks/jenkins-ci | |
# export SLACK_TOKEN=<YOUR_SLACK_TOKEN> | |
# export SLACK_CHANNEL=<YOUR_SLACK_CHANNEL> | |
export REPORT_URL=${REPORT_URL:-$JENKINS_URL/job/$JOB_NAME/$BUILD_NUMBER/rcov/} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Teads Sponsored Challenge | |
num = ARGF.gets.to_i # the number of adjacency relations | |
edges = {} # node_idx -> {n1: 1, n2: 2} | |
num.times do | |
# xi: the ID of a person which is adjacent to yi | |
# yi: the ID of a person which is adjacent to xi | |
xi, yi = ARGF.gets.split(' ').collect {|x| x.to_i} | |
edges[xi] = {} unless edges[xi] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
THIS_DIR=$(cd $(dirname $0); pwd) | |
IPA1=$1 | |
IPA2=$2 | |
TMP=${THIS_DIR}/.tmp | |
mkdir -p $TMP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https://www.qualys.com/research/security-advisories/GHOST-CVE-2015-0235.txt | |
cat > GHOST.c << 'EOF' | |
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p /etc/docker/certs.d/docker.d.yumemi.jp/ | |
cat <<EOF >/etc/docker/certs.d/docker.d.yumemi.jp/ca.crt | |
-----BEGIN CERTIFICATE----- | |
MIID1TCCAr2gAwIBAgIDAjbRMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT | |
MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i | |
YWwgQ0EwHhcNMTAwMjE5MjI0NTA1WhcNMjAwMjE4MjI0NTA1WjA8MQswCQYDVQQG | |
EwJVUzEXMBUGA1UEChMOR2VvVHJ1c3QsIEluYy4xFDASBgNVBAMTC1JhcGlkU1NM | |
IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx3H4Vsce2cy1rfa0 | |
l6P7oeYLUF9QqjraD/w9KSRDxhApwfxVQHLuverfn7ZB9EhLyG7+T1cSi1v6kt1e | |
6K3z8Buxe037z/3R5fjj3Of1c3/fAUnPjFbBvTfjW761T4uL8NpPx+PdVUdp3/Jb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
private func encode(obj: AnyObject?) -> AnyObject { | |
switch obj { | |
case nil: | |
return NSNull() | |
case let ojmObject as QiitaEntityBase: | |
return ojmObject.toJsonDictionary() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
private func encode(obj: AnyObject?) -> AnyObject { | |
switch obj { | |
case nil: | |
return NSNull() | |
case let ojmObject as QiitaEntityBase: | |
return ojmObject.toJsonDictionary() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
private func encode(obj: AnyObject?) -> AnyObject { | |
switch obj { | |
case nil: | |
return NSNull() | |
case let ojmObject as JsonGenEntityBase: | |
return ojmObject.toJsonDictionary() |