Skip to content

Instantly share code, notes, and snippets.

View ganta's full-sized avatar
🐤

Hideki Igarashi ganta

🐤
View GitHub Profile
@kiy0taka
kiy0taka / gist:4387787
Last active December 10, 2015 05:28
GVM Grails/Griffon auto switch for zsh.
__gvm_switch() {
if [ -s "gradle.properties" ]; then
local candidate current target
candidate=grails
target=$(cat gradle.properties | grep --color=never 'grailsVersion' | sed "s_grailsVersion=\(.*\)_\1_g")
if [[ $target != '' ]]; then
current=$(eval echo '$'$(echo $candidate | tr '[:lower:]' '[:upper:]')_HOME | sed -e "s_$GVM_DIR/$candidate/__g")
if [[ $current != $target ]]; then
echo "Switching to $candidate $target ..."
gvm offline enable > /dev/null
@taichi
taichi / testing_javascript.md
Last active February 7, 2018 00:09
javascript におけるユニットテストについて (2013/01)

javascript におけるユニットテストについて (2013/01)

ここの所、数か月おきにjsのユニットテストってどうやるのが良いのか悩んでいる気がするので、一つ情報集約の為にメモ書きをしておきます。

何かちゃんと文章書いておけば、それに対する反応が集まって、オレサマハッピー的な展開を望んでいます。

そもそも何を探しているのか

単体テストというか、ユニットテストというか、そういうアレを書く為のフレームワークを探しています。
覚える事が少なくて強力なやつ。

機能テストというか、e2eテストいうか、そういうアレの事は別途考える必要がありますので、今回はスコープ外とします。

@ywatase
ywatase / _plenv.zsh
Last active December 11, 2015 11:48
#compdef plenv
# Installation
#
# * rename '_plenv.zsh' to '_plenv'
# * put on $HOME/.zsh/functions/
typeset -A opt_args
local context state line
@mala
mala / gist:5107120
Last active March 19, 2020 01:41
TwitterのOAuthの問題の補足とか

https://gist.github.com/mala/5062931

の続き。

Twitterの人に色々と問題点は伝えたんだけど、これからOAuthのサーバー書く人や、クライアント書く人が似たような問題を起こさないようにするために、どうすればいいのかについて簡単に書きます。既存の実装真似して作るとうっかりひどい目にあう。

自分は意図的に「Twitterの脆弱性」という表現を使わないように気を使っていて、それはクライアントアプリ側の責任もあるからなのだけれども、安全に実装するための方法がわかりにくかったり誤解を招きやすかったり、Twitterに買収されているTweetDeckにも問題があったりしたので、それはやっぱりTwitter側の責任の比重が大きいとは思う。とはいっても別に責任を追求したかったり◯◯はクソだといったことを言いたいわけではなく、誰が悪いとか言う以前に、複合的な要因によって問題が起きるときには原因を正しく理解する必要があると思う。

そもそも何を担保に安全性を保証しているのか

  • サーバー側で秘密の鍵を持っている(それが無いとアクセストークンを取得できない or 使えない)
@tonek
tonek / jetty.sh
Last active December 16, 2015 01:48
install jetty 9 CentOS
cd ~
sudo wget http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.2.1.v20140609.tar.gz -O jetty.tar.gz
tar -xf jetty.tar.gz
rm -rf jetty.tar.gz
mv jetty-* jetty
sudo /usr/sbin/useradd jetty
sudo mv jetty /srv/
@japboy
japboy / jade-ftw.md
Last active October 23, 2023 11:18
Jade について。

Jade FTW

こんにちは。今回は現実逃避を兼ねて Jade の素晴らしさをお伝えしたいと思います。

Jade とは何か

[Jade][0] は JST (JavaScript Templates) の一つであり、HTML を書くための[軽量マークアップ言語][1] である [Haml][2] に影響を受けた JavaScript テンプレートエンジンでもあります。

@shyouhei
shyouhei / git-strata.rb
Last active December 8, 2019 07:35
This is git-strata, an extended version of git-blame. It takes a path and generates git-blame like output. The difference is, it also shows you how much edits the line experienced.
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Urabe, Shyouhei
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@takaxp
takaxp / emacs-25.1-inline.patch
Last active April 25, 2017 11:14
An inline-patch for emacs-25.1 (入力時のチラつきなしバージョン)
diff -crN emacs-25.1-orig/configure.ac emacs-25.1-new/configure.ac
*** emacs-25.1-orig/configure.ac 2016-07-24 23:56:46.000000000 +0900
--- emacs-25.1-new/configure.ac 2016-09-13 01:09:24.000000000 +0900
***************
*** 1916,1922 ****
INSTALL_ARCH_INDEP_EXTRA=
fi
! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o $ns_fontfile"
fi