Skip to content

Instantly share code, notes, and snippets.

@cvan
cvan / set-up-chromium-keys.md
Last active March 19, 2024 10:44
Launch Chromium with API Keys on Mac OS X and Windows

Last Updated: March 2023

IMPORTANT: Ignore the out-of-date steps below for getting Chromium keys.

Instead, read this up-to-date guide (Jan 2023) written by @LearningToPi.

P.S. Thank you to every contributor below who provided tips over the years on what should be a straightforward process: setting up Chromium for local development.

Long live the web!

@hiroyuki-sato
hiroyuki-sato / Liquid.md
Last active December 2, 2020 13:38
Embulk、path_prefixに日付をダイナミックに挿入する方法

conf.yml.liquid

{% capture today %}{{ 'now' | date: '%Y%m%d' }}{% endcapture %}
in:
  type: file
  path_prefix: /private/tmp/sample/csv/sample_{{ today }}
 decoders:

子育て5ヶ月やって、先に知っておきたかったこと

現時点で子どもがちょうど5ヶ月になる。
子育ては、やりながらノウハウが溜まっていくと実感している。
その中で、「これはもっと早く知っておけば良かった」と思ったものを記録しておく。

夜長く眠れるようにする

生後すぐは生活サイクルが変わって体力的なしんどさがある。

@sunaot
sunaot / if.md
Last active October 2, 2019 15:15
条件分岐とのつきあい方

条件分岐とのつきあい方

プログラムが複雑になる一番の理由は条件分岐 (if 文など) です。

条件分岐がなければ、一本道で読み下していけばいいのでバグが入り込む余地は大変少なくなります。

ということで、

  • 条件分岐を書かなくていいように書く
  • 条件分岐を書くなら、わかりやすく局所化して書く
@limitusus
limitusus / paraserv.pl
Created February 7, 2013 18:02
TCP server that listens on multiple processes: accept succeeds only on one process for a connection.
#!/usr/bin/env perl
use strict;
use warnings;
use Socket;
use IO::Socket;
use IO::Socket::INET;
use IO::Select;
use IO::Handle;
@kazuho
kazuho / gist:4122754
Created November 21, 2012 03:00
The "queue_stats()" function, introduced in Q4M 0.9.7
How it looks like
==================================
mysql> select queue_stats('t');
+------------------------------------------------------------------------------------------------------------------------------+
| queue_stats('t') |
+------------------------------------------------------------------------------------------------------------------------------+
| rows_written: 0
rows_removed: 0
wait_immediate: 0
@silenvx
silenvx / borders.patch
Created October 15, 2012 21:04
tmuxのペインの境目に使われる罫線を書き換えただけのpatch
diff -Narup tmux-1.6.orig/tty-acs.c tmux-1.6/tty-acs.c
--- tmux-1.6.orig/tty-acs.c 2012-10-15 00:13:51.729160450 +0900
+++ tmux-1.6/tty-acs.c 2012-10-15 00:35:51.770801087 +0900
@@ -41,21 +41,21 @@ const struct tty_acs_entry tty_acs_table
{ 'g', "\302\261" },
{ 'h', "\342\226\222" },
{ 'i', "\342\230\203" },
- { 'j', "\342\224\230" },
- { 'k', "\342\224\220" },
- { 'l', "\342\224\214" },
@netologist
netologist / MountainLion-Python-Fix
Created July 27, 2012 05:44 — forked from sonicradish/MountainLion-Python-Fix
Fix Mountain Lion 10.8 Python IOError pyconfig.h Error
After upgrading to Mountain Lion : 10.8 I noticed that I was getting Python errors which prevented me from starting vim:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 565, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 547, in main
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 523, in get_config_var
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 419, in get_config_vars
@Cside
Cside / colorize.pl
Created June 14, 2012 09:54
colorize keywords of logs.
#!/usr/bin/env perl
=head1 Examples
$ tail -f access_log | perl colorize.pl
$ plackup app.psgi 2>&1 | perl colorize.pl
=cut
use strict;
@takus
takus / .perltidyrc
Created April 10, 2012 11:15
.perltidyrc described in "Perl Best Practice"
# Max line width is 78 cols
-l=78
# Indent level is 4 cols
-i=4
# Continuation indent is 4 cols
-ci=4
# Output to STDOUT