Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use strict;
use warnings;
use File::Find;
use File::Spec;
my %modules = ();
for my $path (grep { $_ ne '.' } @INC) {
find(+{
#!/usr/bin/env perl
use strict;
use warnings;
use File::Find;
use File::Spec;
my %modules = ();
my %inc = map { $_ => $_ } map { File::Spec->canonpath($_) } @INC;
@sugyan
sugyan / notify_status.sh
Last active August 29, 2015 14:00
Get weechat status from tmux command
#!/bin/sh
if [ -n "${VPS_HOST}" ]; then
status=$(ssh ${VPS_HOST} 'curl "https://gist.githubusercontent.com/sugyan/11364796/raw/weechat_status_from_tmux.sh" 2> /dev/null | sh')
if [ -n "${status}" ]; then
echo display notification \"${status}\" with title \"weechat status\" | osascript
fi
fi
function percol_select_directory() {
local tac
if which tac > /dev/null; then
tac="tac"
else
tac="tail -r"
fi
local dest=$(_z -r 2>&1 | eval $tac | percol --query "$LBUFFER" | awk '{ print $2 }')
if [ -n "${dest}" ]; then
cd ${dest}
#!/bin/sh
for fifo in $HOME/.weechat/weechat_fifo_*; do
echo '*/mute layout save' > $fifo
echo '*/mute save weechat' > $fifo
done
BUFFER=$(grep 'default.buffer' $HOME/.weechat/weechat.conf | cut -d'"' -f2 | percol | cut -d';' -f3)
if [ -n "$BUFFER" ]; then
for fifo in $HOME/.weechat/weechat_fifo_*; do
;; use "Show documentation" as 1st action
(eval-after-load "helm-go-package"
'(progn
(let* ((actions (helm-attr 'action helm-source-go-package))
(godoc (nth 2 actions)))
(delete godoc actions)
(push godoc actions)
(helm-attrset 'action actions helm-source-go-package))))
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.lang.reflect.Array;
import java.util.ArrayList;
public class Deserializer {
public static void main(String[] args) {
String filepath = args[0];

Reactに触れてみて

特徴:

  • 描画するComponentに分けて管理・再利用できる
  • 状態が変化し再描画が必要になっても最小限の更新差分でやってくれる
  • server side renderingにも対応しているのでSEO対策にも効く

というところで 使いどころは

  • 要素の動的変更が多いsingle page application
  • ある程度動的で、かつSEOも考慮したいWebアプリ
$ for s in $(echo 1 | sed -E "s/(.*)/\1+2\n\1-2\n\12/" | sed -E "s/(.*)/\1+3\n\1-3\n\13/" | sed -E "s/(.*)/\1+4\n\1-4\n\14/" | sed -E "s/(.*)/\1+5\n\1-5\n\15/" | sed -E "s/(.*)/\1+6\n\1-6\n\16/" | sed -E "s/(.*)/\1+7\n\1-7\n\17/" | sed -E "s/(.*)/\1+8\n\1-8\n\18/" | sed -E "s/(.*)/\1+9\n\1-9\n\19/"); do echo $s | bc | grep -q ^100 && echo $s; done
1+2+3-4+5+6+78+9
1+2+34-5+67-8+9
1+23-4+5+6+78-9
1+23-4+56+7+8+9
12+3+4+5-6-7+89
12+3-4+5+67+8+9
12-3-4+5-6+7+89
123+4-5+67-89
123+45-67+8-9
perl -le'print$~^" !#64:"'