Skip to content

Instantly share code, notes, and snippets.

Avatar

Kensuke Nagae kyanny

View GitHub Profile
@shanselman
shanselman / gist:5422230
Last active Nov 26, 2020
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')
View alert.js
alert('hello ' + document.location.href);
@keithamus
keithamus / Nano Git Commit Syntax highlighting
Created Dec 10, 2010
Add this to your ~/.nanorc and when running "git commit" (if your editor is nano) you'll have syntax highlighting in your commit message. Includes support for "git commit -v" too!
View Nano Git Commit Syntax highlighting
syntax "gitcommit" "COMMIT_EDITMSG$"
color white "#.*"
color green "#.(modified|deleted).*"
color yellow start="# Changes.*" end="# Changed.*"
color cyan start="# Untracked.*" end="diff"
color cyan start="# Untracked.*" end="$$"
color brightred "^deleted file mode .*"
color brightgreen "^\+.*"
color brightred "^-.*"
color brightyellow "^(diff|index|---|\+\+\+).*"
View 2013RubyKaigiのもやもや問題を自分なりに整理
みなさまRubyKaigiお疲れ様でしたー。素敵なKaigiに再会できてうれしかったです。
RubyKaigiまわりで、同じ分野の問題提起が二つありましたねぇ。
一つはKaigi中での、「台湾の女の子はKawaii、だからRubyKaigi Taiwanに来るべき」という発言、
それを笑いで迎えた場内に対して、女性への配慮が足りないだろうという意見。
https://gist.github.com/kyanny/5694201
もう一つは、続くRubyHirobaでの、ポルノに関しての情報処理技術についてのLTがあったこと。
(そして、実際にそれを聞いて傷ついた女性が存在し、問題が提起されました)
RubyhirobaはRubyKaigiとは独立した、せっかく東京にRubyistがたくさん居るんだから交流しよう!という、
LTとWorkshopと交流の場を提供するイベントです。
@kconragan
kconragan / keyrepeat.shell
Last active Sep 22, 2020
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.
@mars
mars / register_chrome_with_window_size.rb
Created Oct 13, 2013
Set window size for Capybara/Selenium/chromedriver
View register_chrome_with_window_size.rb
Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app,
browser: :chrome,
desired_capabilities: {
"chromeOptions" => {
"args" => %w{ window-size=1024,768 }
}
}
)
end
@bjhess
bjhess / pull_request_webhook.md
Created May 18, 2012
The way I had to add a github repo webhook for pull requests
View pull_request_webhook.md

This is more complex than necessary.

GitHub webhooks for a URL by default only fire on repo pushes. There appears to be no way in the web UI to set up webhooks for other events. And so we go to the API. I prefer to do this type of thing with Hurl.

{
  "name": "web",
  "active": true,
View goscheduler.md

go 1.1 scheduler

where

src/pkg/runtime proc.c asm_*.s

design

@mala
mala / gist:5062931
Last active Mar 18, 2020
TwitterのOAuthの問題まとめ
View gist:5062931

どういう問題があったか

説明するのめんどい http://vividcode.hatenablog.com/entry/twitter-oauth-vulnerability

どういう対策がされたか

とりあえず即座に攻撃できるような状態ではなくなっています。

フィッシング?

You can’t perform that action at this time.