Skip to content

Instantly share code, notes, and snippets.

View castaneai's full-sized avatar
🥳
Watching anime

castaneai castaneai

🥳
Watching anime
View GitHub Profile
@castaneai
castaneai / gameserver.go
Last active November 29, 2023 05:54
Agones high density GameServer example with label locking method.
package main
import (
"context"
"log"
"os"
"os/signal"
"syscall"
"time"
@castaneai
castaneai / ptes.cpp
Created January 29, 2020 08:31
ptes
#include "../headers/EARTH_PT3.h"
#include "../headers/EX_Buffer.h"
#include "Windows.h"
int main(void)
{
auto dll = LoadLibrary(L"SDK_EARTHSOFT_PT3.dll");
auto newBusFunc = reinterpret_cast<EARTH::PT::Bus::NewBusFunction>(GetProcAddress(dll, "_"));
EARTH::PT::Bus* bus;
@castaneai
castaneai / client.go
Created July 29, 2019 03:25
[gRPC Channelz] show trace on client connection
package main
import (
"context"
"github.com/golang/protobuf/ptypes"
"google.golang.org/grpc/reflection"
"log"
"net"
"os"
"time"
@castaneai
castaneai / tbf06.gs
Created March 18, 2019 14:22
tbf06 checked count
function fetch() {
var headers = {"Cookie": "user=xxxxxxxxxxxxxxxxxx;"}; // <- insert your cookie here
var params = {
"method": "GET",
"headers": headers,
};
var url = "https://techbookfest.org/api/circle/own";
var resp = UrlFetchApp.fetch(url, params);
return JSON.parse(resp.getContentText());
}
@castaneai
castaneai / migrate-repo.sh
Created January 8, 2019 02:57
Migrating private repo to GitHub from GitLab.
#!/bin/bash
GITLAB_USER=castaneai
GITHUB_USER=castaneai
REPO_NAME=$1
git clone --mirror https://gitlab.com/$GITLAB_USER/$REPO_NAME && cd $REPO_NAME.git && hub create -p $REPO_NAME && git remote set-url origin https://github.com/$GITHUB_USER/$REPO_NAME.git && git push --mirror

Keybase proof

I hereby claim:

  • I am castaneai on github.
  • I am castaneai (https://keybase.io/castaneai) on keybase.
  • I have a public key ASB0UigtWHu8Gzb_dS1eE-uLPeKvrsRfuDpDea9x7MHGbAo

To claim this, I am signing this object:

@castaneai
castaneai / App.tsx
Created November 20, 2018 06:23
react list start
import React, { Component } from 'react';
import './App.css';
import ItemList from "./ItemList";
import Item from "./Item";
interface Props {
}
interface State {
items: Item[]
}
@castaneai
castaneai / main.go
Created November 1, 2018 05:14
gae/go + spanner + opencensus
package main
import (
"cloud.google.com/go/spanner"
"context"
"contrib.go.opencensus.io/exporter/stackdriver"
"fmt"
"go.opencensus.io/plugin/ochttp"
"go.opencensus.io/trace"
"log"
<public:attach event="onload" for="window" onevent="initialise()" />
<script language="javascript">
function initialise() {
document.write("goooooooooooooooooooooooooold");
}
</script>
@castaneai
castaneai / tee.go
Created October 25, 2018 10:04
io.TeeReader example
package main
import (
"os"
"io"
"log"
)
func main() {
filename := os.Args[1]