Skip to content

Instantly share code, notes, and snippets.

View tanb's full-sized avatar
:shipit:
🐁🗯

Tomonori Tanabe tanb

:shipit:
🐁🗯
View GitHub Profile
@tanb
tanb / gist:6b27538e3d3e5d04a968c061adb401f0
Created November 1, 2023 10:58
setup tailscale amazon linux 2
sudo yum install yum-utils
sudo yum-config-manager --add-repo https://pkgs.tailscale.com/stable/amazon-linux/2/tailscale.repo
sudo yum install tailscale
sudo systemctl enable --now tailscaled
sudo tailscale up
echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p /etc/sysctl.conf
sudo tailscale up --advertise-exit-node
@tanb
tanb / fetch.py
Created September 3, 2017 16:20
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import click
@click.command()
@click.option('--outfile', '-o')
@click.argument('src')
def fetch(outfile, src):
import requests

Install vagrant

 $ brew cask install vagrant
==> Downloading https://releases.hashicorp.com/vagrant/1.8.7/vagrant_1.8.7.dmg
######################################################################## 100.0%
==> Verifying checksum for Cask vagrant
==> Running installer for vagrant; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
==> installer: Package name is Vagrant
@tanb
tanb / hoge.swift
Created May 22, 2016 17:55
po (print object) Alamofire.Response.data as a String
po String.init(data: response.data!, encoding: NSUTF8StringEncoding)

Keybase proof

I hereby claim:

  • I am tanb on github.
  • I am tanb (https://keybase.io/tanb) on keybase.
  • I have a public key whose fingerprint is D854 BC00 7352 C128 8FCB 4536 5825 714E 2349 64DC

To claim this, I am signing this object:

@tanb
tanb / dev_android.md
Last active May 10, 2016 17:50
Android app development: Let's Get Started

Let's Get Started

  • install java
$ brew cask install java
  • .bash_profile
@tanb
tanb / xhyve-nextbsd-tutorial.md
Last active June 10, 2017 06:37
NextBSD running on xhyve.

NextBSD Running on Xhyve.

  _   _           _   ____ ____  ____
 | \ | | _____  _| |_| __ ) ___||  _ \
 |  \| |/ _ \ \/ / __|  _ \___ \| | | |
 | |\  |  __/>  <| |_| |_) |__) | |_| |
 |_| \_|\___/_/\_\\__|____/____/|____/

                                              ```                        `
 s` `.....---.......--.``` -/
@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

- PROPERTYANIMATION
struct PropertyAnimation * property_animation_create_layer_frame(struct Layer * layer, GRect * from_frame, GRect * to_frame)
struct PropertyAnimation * property_animation_create(const struct PropertyAnimationImplementation * implementation, void * subject, void * from_value, void * to_value)
void property_animation_destroy(struct PropertyAnimation * property_animation)
void property_animation_update_int16(struct PropertyAnimation * property_animation, const uint32_t distance_normalized)
void property_animation_update_gpoint(struct PropertyAnimation * property_animation, const uint32_t distance_normalized)
void property_animation_update_grect(struct PropertyAnimation * property_animation, const uint32_t distance_normalized)
struct PropertyAnimation {
Animation animation
struct PropertyAnimation::@13 values
- drowing path
GPath * gpath_create(const GPathInfo * init)
void gpath_destroy(GPath * gpath)
void gpath_draw_filled(GContext * ctx, GPath * path)
void gpath_draw_outline(GContext * ctx, GPath * path)
void gpath_rotate_to(GPath * path, int32_t angle)
void gpath_move_to(GPath * path, GPoint point)
struct GPath {
uint32_t num_points
GPoint points