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
#include <iostream> | |
#include <memory> | |
using namespace std; | |
struct A { | |
void release() { cout << "Release!!" << endl; } | |
}; | |
struct deleter { void operator()(A* a) { a->release(); } }; | |
unique_ptr<A, deleter> f() |
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
#include <Windows.h> | |
#include <codecvt> | |
#include "iTunesCOMInterface.h" | |
using namespace std; | |
string wstring_to_string(const std::wstring& wstr) | |
{ | |
wstring_convert<codecvt_utf8<wchar_t>> cvt; |
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
using UnityEngine; | |
using UniRx; | |
using UniRx.Triggers; | |
public class MainCamera : MonoBehaviour | |
{ | |
void Start() | |
{ | |
this.UpdateAsObservable() |
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
using System; | |
using System.Collections; | |
using UnityEngine; | |
using UniRx; | |
using UniRx.Triggers; | |
public class Player : MonoBehaviour { | |
void Start() { | |
Func<KeyCode, IObservable<Unit>> onGetKey = (keyCode) => this.UpdateAsObservable().Where(_ => Input.GetKey(keyCode)); |
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
using UnityEngine; | |
using System; | |
using System.Collections; | |
using UniRx; | |
using UniRx.Triggers; | |
public class TPSCamera : MonoBehaviour { | |
public GameObject player; | |
public GameObject anchor; |
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
using UnityEngine; | |
namespace Assets.Scripts | |
{ | |
public static class GameObjectExtension | |
{ | |
public static void AddChild(this GameObject parent, GameObject child) | |
{ | |
var instantiatedObject = GameObject.Instantiate(child); | |
instantiatedObject.transform.parent = parent.transform; |
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
FROM vimagick/h2o | |
COPY docker-entrypoint.sh /entrypoint.sh | |
RUN chmod a+x /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] |
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
open SharpPcap | |
type Sniffer() = | |
let device = (CaptureDeviceList.Instance |> Seq.head) | |
member this.Start() = device.Open() | |
member this.GetNextPacket() = device.GetNextPacket() | |
module Main = | |
[<EntryPoint>] | |
let main argv = |
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 struct | |
class Struct: | |
_fields = None # type: tuple | |
_size = None # type: int | |
@classmethod | |
def size(cls): | |
if cls._size is None: |
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
/** | |
* "1A 2B 3C" のような16進数表記文字列をバイト配列に変換する | |
*/ | |
$scope.hexs2bytes = function(hexs) { | |
return hexs.split(' ').map(function(h) { return parseInt(h, 16) }); | |
}; | |
/** | |
* バイト配列を"1A 2B 3C"のような16進数表記文字列に変換する | |
*/ |