Skip to content

Instantly share code, notes, and snippets.

View tokuda109's full-sized avatar
🐥
pith pith pith

Tsuyoshi Tokuda tokuda109

🐥
pith pith pith
View GitHub Profile
@areknawo
areknawo / LazyHydrate.vue
Created August 13, 2021 11:18
Vue 3 lazy hydration component
<script lang="ts">
import { defineComponent, onMounted, PropType, ref, watch } from "vue";
type VoidFunction = () => void;
const isBrowser = () => {
return typeof window === "object";
};
export default defineComponent({
props: {
@ClickerMonkey
ClickerMonkey / types.ts
Last active August 8, 2024 00:25
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
@erukiti
erukiti / review.md
Last active October 20, 2024 03:33
Re:VIEWチートシート

Re:VIEWチートシート

いつもいつもいつもRe:VIEWの記法に悩んでぐぐってしまう皆さんへ送るチートシートです。

基本

名称 ルール 概要・備考
段落 1行以上の空行をはさむと別の段落になる HTMLでいうP
見出し =ではじまる行 =の個数で、章・節・項・段という感じで増えます。HTMLで言うH1, H2, H3, H4, H5
@paulirish
paulirish / bling.js
Last active February 18, 2025 14:08
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };

How to combine AWS Elastic Beanstalk, Docker and AWS CloudFormation

Introduction

This text explains how to create and deploy a Docker-based AWS Elastic Beanstalk site and how to control it using CloudFormation.

Please find the CloudFormation template at the end of this Gist.

We assume that you are familiar with AWS ElasticBeanstalk, AWS CloudFormation and Docker.

@bennadel
bennadel / isolate-scope-directive.htm
Created June 16, 2014 12:15
Using Isolate Scope In Directives In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Using Isolate Scope In Directives In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@yasushiyy
yasushiyy / vagrant_coreos_docker.md
Last active January 28, 2019 11:35
Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。

2014年6月11日時点での情報。

  • Version: CoreOS 343.0.0
  • Kernel: 3.14.5
  • Docker: 1.0
@0xced
0xced / UIPageViewController+ReloadData.h
Last active May 16, 2020 02:51
Reload data workaround for UIPageViewController
#import <UIKit/UIPageViewController.h>
// Because UIPageViewController somehow "caches" its view controllers when you pass animated:YES and there is no "reloadData" method in UIPageViewControllerDataSource
@interface UIPageViewController (ReloadData)
- (void) xcd_setViewControllers:(NSArray *)viewControllers direction:(UIPageViewControllerNavigationDirection)direction animated:(BOOL)animated completion:(void (^)(BOOL))completion;
@end