Skip to content

Instantly share code, notes, and snippets.

Avatar

Kensuke Nagae kyanny

View GitHub Profile
@shanselman
shanselman / gist:5422230
Last active Jul 24, 2021
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
View gist:5422230
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@kconragan
kconragan / keyrepeat.shell
Last active Jul 18, 2021
Enable key repeat in Apple Lion for Sublime Text in Vim mode
View keyrepeat.shell
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@kawsark
kawsark / Vault-ssh-ca-README.md
Created Mar 28, 2019
A guide for configuring Vault's SSH-CA
View Vault-ssh-ca-README.md

SSH CA use-case with Vault

In this scenario we are going to set up Vault to sign SSH keys using an internal CA. We will configure the SSH secrets engine and create a CA within Vault. We will then configure an SSH server to trust the CA key we just created. Finally we will attempt to SSH using a private key, and a public key signed by Vault SSH CA.

Prerequisites

  • This guide assumes you have already provisioned a Vault server, SSH host using OpenSSH server, and a SSH client machine.
  • The client system must be able to reach the Vault server and the OpenSSH server.
  • We will refer to these systems respectively as:
    • VAULT_SERVER
View ghe-revealer.rb
#!/usr/bin/sudo ruby
#
# revealer.rb -- Deobfuscate GHE .rb files.
#
# This is simple:
# Every obfuscated file in the GHE VM contains the following code:
#
# > require "ruby_concealer.so"
# > __ruby_concealer__ "..."
@imaya
imaya / gist:7938720
Created Dec 13, 2013
退職エントリ
View gist:7938720

入社から退職に至るまでの経緯

この記事は退職 Advent Calendar 13 日目の記事です。 本日が最終出社となりましたので、入社から退社までを振り返り整理しようと思い、この文章を書いています。

はじめに

自分語りなので興味ない人はさっさと戻ったほうが良いです。 簡単にまとめると、元々あまり執着ないしやることない、なんか最近クソみたいな社内ポリシーがいっぱい出来て萎える、話の合う人がやめることにしたから会社にいる意味を感じないため辞めるということです。

@edgimar
edgimar / copy-org-mode-link.js
Last active Mar 22, 2021
User-script to copy the currently browsed web-page and selected content to the clipboard for pasting into org-mode
View copy-org-mode-link.js
View alert.js
alert('hello ' + document.location.href);
@doi-t
doi-t / setting_default_value.bash
Last active Feb 7, 2021
シェル変数のデフォルト値を設定する
View setting_default_value.bash
#!/bin/bash
foo=${1:-hoge}
echo $foo #$1がなかったらhogeをデフォルト値としてfooに代入する
#var自身にデフォルト値としてhogeを代入としたいので以下のように書きたい
${var:=hoge} #このままでは、hogeが展開されてしまって、hogeなんてコマンドはないとシェル怒られる
echo "1:$var"
var=