Skip to content

Instantly share code, notes, and snippets.

View shiwano's full-sized avatar
💭
😇

Shogo Iwano shiwano

💭
😇
View GitHub Profile
import 'dart:math' show max;
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:webview_flutter/webview_flutter.dart';
class ExpandableWebView extends StatefulWidget {
final String url;
final EdgeInsets padding;
@posener
posener / go-table-driven-tests-parallel.md
Last active April 4, 2024 19:45
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@ahmetb
ahmetb / gcrgc.sh
Last active February 26, 2024 09:14
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 25, 2024 12:42
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
fs = require "fs"
eco = require 'eco'
RPC = {}
header = '''
class Struct
class Request
'''
type_template = '''

花火~ 最高な俺たちと糞コードの海

written by mizchi at 小物エンジニアの会.

最高の夏の花火について 花火

自己紹介

@michaelbartnett
michaelbartnett / LICENSE.txt
Last active October 17, 2022 10:29
Tuple implementation for use with Unity3d
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@0mg
0mg / twoauth.md
Created March 30, 2013 14:32
OAuth 対応 Twitter クライアント作成メモ

OAuth 対応 Twitter クライアント作成メモ

  • 前提: OAuth version 1.0a, Twitter API 1.1

OAuth 認証を通じてツイートするのに必要なたった 1 つのこと

リクエストヘッダに Authorization フィールドをセットする

OAuth 認証を通じてツイートするためには、API に対して POST する際、リクエストヘッダに Authorization フィールドを含める必要がある。

@studiomohawk
studiomohawk / five-2013-02-08.md
Created February 8, 2013 00:12
CSS Radar @ Twitter / 2013.02.08 Friday Edition

CSS Radar - 2013/02/08

ページロードのパフォーマンス改善に関するテクニックについての情報はこの数年で少し落ち着いて来た。そこで次はロードの後のパフォーマンスについて。
Addy Osmani氏によるGoogle Chromeの開発ツールを使ったスクロール速度の改善手法について。レンダリングエンジンの仕組み、そして開発ツールを使った問題の発見と、修正方法、ついでにワークフローまでついているというすばらしい記事。

JavaScriptにおけるオブザーバデザインパターンの実装に関するティップス。記事の例ではBackbone.jsを利用してはいるが、オブザーバパターンを使う場合に全般当てはまるアドバイスなので、是非。

@walm
walm / sliceit.scpt
Created November 18, 2012 12:33
Run Slicy on PSD from command line using AppleScript
on run argv
set input_file to POSIX file (item 1 of argv)
set output_path to item 2 of argv
-- TODO: add some error handling :)
-- make sure output folder exists
do shell script "mkdir -p " & output_path
-- drop input file on Slicy app