- Find files containing "foo", and print the line matches in context:
ag foo
- Find files containing "foo" in a specific directory:
ag foo path/to/directory
- Find files containing "foo", but only list the filenames:
ag -l foo
- Find files containing "FOO" case-insensitively, and print only the match, rather than the whole line:
ag -i -o FOO
- Find "foo" in files with a name matching "bar":
ag foo -G bar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# One of the steps, insert where you wish: | |
- run: | |
name: run rubocop | |
command: | | |
source /home/circleci/.rvm/scripts/rvm | |
rvm --default use 2.3.1 | |
bash bin/rubocop.sh | |
# Remove the RVM lines if not needed for your setup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |