Skip to content

Instantly share code, notes, and snippets.

@davidbella
davidbella / tmux-highlight-text-patch-README.md
Created January 10, 2017 21:59 — forked from pxsta/tmux-highlight-text-patch-LICENSE
tmux-highlight-text.patch enables tmux to highlight the text like iTerm2.

tmux-highlight-text.patch

This patch enables tmux to highlight the text like iTerm2.
When some text in the terminal matches the regular expression set in tmux.conf, tmux highlights them.

patch gif

usage

install

@davidbella
davidbella / app.js
Created January 12, 2014 21:19
Node: Super simple web server with Express
var express = require('express');
var app = express();
app.get('/', function(req, res) {
res.send('hello world');
});
app.get('/david', function(req, res) {
res.send('hello david');
});
@davidbella
davidbella / server_function.js
Created January 10, 2014 03:04
Node: Simple HTTP server, function separated for demonstration
var http = require('http');
function server_response(request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.write('Hello World');
response.end();
};
var server = http.createServer(server_response);
@davidbella
davidbella / server.js
Created January 10, 2014 02:25
Node: Simple web server with built in HTTP
var http = require('http');
var server = http.createServer(function(request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.write('Hello World');
response.end();
})
server.listen(3000);
/**
* Learn HTML & CSS from Scratch
* 4.1: Responsive Layouts
*/
/********** Device Styles **********/
/**
* Tablet Landscape: 1024px
*/
@davidbella
davidbella / capybara cheat sheet
Last active December 27, 2015 18:39 — forked from zhengjia/capybara cheat sheet
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')
@davidbella
davidbella / lcc_ar_migration.regex
Created October 30, 2013 18:22
Regex: Matches _lower_camel_case words for ActiveRecord migrations
http://regex101.com/r/mV8rA7
/(?:_([^_.]+))+?/g
01_create_cats.rb
02_create_all_the_dogs.rb
/(?:_([^_.]+))+?/g
(?:_([^_.]+)) Non-capturing Group 1 to infinite times [lazy]
_ Literal _
@davidbella
davidbella / spec_helper_with_simplecov.rb
Created October 29, 2013 18:46
RSpec: Good simplecov config using Guard notifier
require 'simplecov'
SimpleCov.start do
add_filter '/db/'
add_filter '/config/'
add_filter '/spec/'
add_filter '/public/'
add_filter '/lib/' # Feel free to write coverage for the StudentScrape
SimpleCov.at_exit do
SimpleCov.result.format!
@davidbella
davidbella / .vimrc
Created October 25, 2013 17:35
Vim: My .vimrc
set nocompatible
set number
set cursorline
set ruler
set showmatch
set autoindent
set smartindent
set smarttab
@davidbella
davidbella / grains.rb
Created October 24, 2013 16:12
Ruby: Squaring numbers and the rice checkerboard problem
# There once was a wise servant who saved the life of a prince. The king promised to pay whatever the servant could dream up. Knowing that the king loved chess, the servant told the king he would like to have grains of wheat. One grain on the first square of a chess board. Two grains on the next. Four on the third, and so on.
# There are 64 squares on a chessboard.
# Write a program that shows
# - how many grains were on each square, and
# - the total number of grains
# ## For bonus points