Skip to content

Instantly share code, notes, and snippets.

View tmarcus87's full-sized avatar

T. Ono tmarcus87

View GitHub Profile
package main
:
import文省略
:
var permissions := make(map[string][]string) // なんか読み込む
func hasPermission(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo) bool {
// 例えばCommonName単位でアクセス可能なパスを管理しておいて前方一致で比較する実装
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"time"
(function () {
angular.module('MyModule', [])
.directive(
'autoResizeDirective',
[
'$parse',
function ($parse) {
return {
restrict: 'AC',
scope: true,
@tmarcus87
tmarcus87 / Sample.java
Last active March 29, 2016 08:56
文字列連結パフォーマンステスト
import java.util.*;
import java.lang.*;
import java.io.*;
public class Sample
{
public static void main (String[] args) throws java.lang.Exception
{
exec("+/10times", new Runnable() {
@Override
package entity;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.common.collect.ImmutableMap;
import lombok.AllArgsConstructor;
import lombok.Getter;
@tmarcus87
tmarcus87 / gist:cdf219ea723120213f08
Created June 12, 2015 08:48
JsonSchemaValidatorを色々試してみるテスト
var _ = require('lodash'),
fs = require('fs'),
path = require('path'),
async = require('async'),
request = require('request'),
BaseError = require('src/error/base'),
SystemError = require('src/error/system'),
InvalidParamError = require('src/error/invalidparam')
JsonReader = require('src/util/json_reader');
#!/bin/bash
echo "Current iptables => "
iptables -L
echo "Flush iptables => "
iptables -F
echo "Save iptables => "
service iptables save
public HttpClientFactoryV43 {
private BasicHttpClientConnectionManager connectionManager;
public HttpClientFactoryV43() {
try {
SSLContext sslContext = new SSLContextBuilder()
.loadTrustMaterial(
null,
new TrustSelfSignedStrategy())
public class HttpClientFactory {
public HttpClient insecureClient() {
try {
SSLSocketFactory sslSocketFactory =
new SSLSocketFactory(
new TrustSelfSignedStrategy(),
new AllowAllHostnameVerifier());
SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("https", 8443, sslSocketFactory));
schemeRegistry.register(new Scheme("https", 443, sslSocketFactory));
:syntax on
:set tabstop=4
:set number
:set title
:colorscheme desert