Skip to content

Instantly share code, notes, and snippets.

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
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')
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active February 18, 2025 18:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@runlevel5
runlevel5 / install_ruby_2_0_0_p247_on_osx.md
Last active December 14, 2015 04:08
Installing Ruby 2.0.0-p247 on OSX 10.7+

How to install Ruby 2.0.0-p247 on Mac OSX 10.7+

RVM:

rvm get stable && rvm reload

Firstly, the OpenSSL comes with your OSX 10.7+ is outdated, you need to get latest version

@mislav
mislav / _readme.md
Last active February 19, 2025 20:21
tmux-vim integration to transparently switch between tmux panes and vim split windows

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@willurd
willurd / web-servers.md
Last active March 14, 2025 19:35
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@wsargent
wsargent / docker_cheat.md
Last active June 29, 2024 19:32
Docker cheat sheet
@telent
telent / gist:9742059
Last active December 28, 2024 15:25
12 factor app configuration vs leaking environment variables
App configuration in environment variables: for and against
For (some of these as per the 12 factor principles)
1) they are are easy to change between deploys without changing any code
2) unlike config files, there is little chance of them being checked
into the code repo accidentally
3) unlike custom config files, or other config mechanisms such as Java

What is this about?

Convert your ruby app to run on JRuby (often fairly painless) then deploy it by generating a JAR file (should be reasonably painless) and copying it to the servers you're running on (should be bordering on trivial).

If you've never done Java programming, a JAR is a "Java ARchive" file which is basically a single ZIP file containing all the stuff your app needs to run. So you can install java on a new machine and copy the JAR file onto it, and you're ready to go.

What's wrong with how we do it now?

The usual way of deploying a Ruby app is to write (or copypasta) some Capistrano recipes to have the production machines check it out from a git repo then build it in exactly the same way you do on your Mac. This has downsides:

@leonardofed
leonardofed / README.md
Last active March 14, 2025 18:19
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.