Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
gakuzzzz / file.md
Last active November 23, 2024 08:11
UserId など値型はどうするべきか

UserId などの型はどうするべきか

1. primitive 型をそのまま使う

case class Person(id: Long, name: String, organizationId: Long)
object Person {

  def groupByOrg: Map[Long, Seq[Person]] = ...
@key-amb
key-amb / gist:c641947a2139fdd81684
Last active May 31, 2020 05:12
[WIP] Redis Cluster Specification を翻訳してみる
@asus4
asus4 / JsonNode.cs
Last active November 8, 2021 12:41
Simple json accessibility for Unity.
/**
Copyright (c) 2017 Koki Ibukuro
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@tylerneylon
tylerneylon / json.lua
Last active March 31, 2025 01:08
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@georgeOsdDev
georgeOsdDev / websocket.xml
Last active August 26, 2019 13:26
Tsungによるwebsocket負荷テスト(日本語説明付き)
<!--
http://george-osd-blog.heroku.com/25
http://george-osd-blog.heroku.com/26
-->
<?xml version="1.0"?>
<!-- インストールしたTsungのPathとあっていること -->
<!DOCTYPE tsung SYSTEM "/home/ec2-user/opt/tsung-latest/share/tsung/tsung-1.0.dtd">
<tsung loglevel="notice" version="1.0">
@nakaji-s
nakaji-s / gist:7969970
Last active August 31, 2020 02:02
Goと依存パッケージ管理

このgistは Cloud Foundry Advent Calendar 2013 の16日目の記事です。

はじめに

現在、CloudFoundryのComponentsはGo化しつつあります。それにより、Rubyで実装されていたものに対して性能向上していたり、ソースが読みやすくなっていたりする(こちらは主観ですが・・)半面、開発者にとっての課題も生まれています。その課題のひとつが__依存パッケージ管理__です。まずはRubyの外部パッケージ管理について簡単に振り返りつつ、Goのそれを見ていこうと思います。

依存パッケージ管理(Ruby)

Rubyでは外部パッケージはGemファイルとなっており、大抵の場合、Bundlerで管理します。また、最新版が動くとは限らないため設定ファイルにバージョンを指定してそれを使用します。Gemファイル自体はRubyGems.orgに置かれており、ここからダウンロードされます。

依存パッケージ管理(Go)

Goではソースコード中のimport句でパッケージを指定します。設定ファイルは使いません。以下に例を示します。

@fritzy
fritzy / getmsgpackasjson.lua
Created November 6, 2013 17:35
Redis scripts to set JSON in, store as MSGPack, and get JSON out.
--EVAL 'this script' 1 some-key
local key = KEYS[1];
local value = redis.call('GET', key);
local jvalue = cjson.encode(cmsgpack.unpack(value));
return jvalue;
@mikezila
mikezila / BezierMesh.cs
Last active July 18, 2019 17:01
C# for Unity3D. Creates meshes from bezier patches. The resulting meshes are ready-to-render, including texture UVs.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class BezierMesh
{
public Mesh mesh;
public List<Vector2> uvs;
// Calculate UVs for our tessellated vertices
@mtgto
mtgto / proxy.rb
Created September 25, 2013 03:02
対sbt用proxy (ruby製。typoあり)
require 'socket'
require 'net/http'
require 'uri'
class Proxy
PORT = 8888
def initialize
@server_socket = TCPServer.open(nil, PORT)
@responses = {}