Skip to content

Instantly share code, notes, and snippets.

@devver
devver / terms_of_service.markdown
Last active October 22, 2023 03:35
A general Terms of Service under the Creative Commons License

Terms of Service

Last revised on [DATE]

The Gist

[COMPANY] operates the [SERVICE] service, which we hope you use. If you use it, please use it responsibly. If you don't, we'll have to terminate your account.

For paid accounts, you'll be charged on a monthly basis. You can cancel anytime, but there are no refunds.

Privacy Policy

Last revised on [DATE]

The Gist

[COMPANY] will collect certain non-personally identify information about you as you use our sites. We may use this data to better understand our users. We can also publish this data, but the data will be about a large group of users, not individuals.

We will also ask you to provide personal information, but you'll always be able to opt out. If you give us personal information, we won't do anything evil with it.

@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')
@tmm1
tmm1 / bench.rb
Created June 30, 2010 03:12
performance improvements for Bundler and Gem::Version#<=>
require 'rubygems'
# diff --git a/lib/rubygems/version.rb b/lib/rubygems/version.rb
# index 50d8204..4962ce1 100644
# --- a/lib/rubygems/version.rb
# +++ b/lib/rubygems/version.rb
# @@ -295,12 +295,16 @@ class Gem::Version
# rhsize = other.segments.size
# limit = (lhsize > rhsize ? lhsize : rhsize) - 1
#
#!/bin/bash
# Shell Script for super-respositores that executes git on all sub-repositories
# Homepage at http://www.bitweaver.org/wiki/supergit
# Licensed under the GPL
# Authors: github.com/spiderr
function usage {
appName=`basename $0`
echo "Welcome to $appName. It acts on all directories in your project as if they were sub-respositories. For most commands, you simply type what you would normally for git, however you simply type $appName with desired parameters in the super-repository root of your project. For example:"
echo "-- To clone, type '$appName git@github.com:bitweaver/bitweaver.git -b DEV testbw' which will clone, then intiliaze + update submodules and checkout the master branch for each submodule"
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
@napcs
napcs / .vimrc
Last active December 14, 2022 17:40
Set up Vim on Mac, Linux, or Windows. For Mac and Linux: sh <(curl -s https://gist.githubusercontent.com/napcs/532968/raw/vim.sh)
if has('win32') || has ('win64')
let $VIMHOME = $HOME."/Dropbox/dotfiles/.vim"
if !empty($CONEMUBUILD)
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
endif
URL Page_Title Date Transcript Img_Title Img_URL Keywords from http://www.andromedayelton.com/dckx.php
http://xkcd.com/1 Barrel - Part 1 [[A boy sits in a barrel which is floating in an ocean.]] Boy: I wonder where I'll float next? [[The barrel drifts into the distance. Nothing else can be seen.]] {{Alt: Don't we all.}} Don't we all. http://imgs.xkcd.com/comics/barrel_cropped_(1).jpg
http://xkcd.com/2 Petit Trees (sketch) [[Two trees are growing on opposite sides of a sphere.]] {{Alt-title: 'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch}} 'Petit' being a reference to Le Petit Prince, which I only thought about halfway through the sketch http://imgs.xkcd.com/comics/tree_cropped_(1).jpg
http://xkcd.com/3 Island (sketch) [[A sketch of an Island]] {{Alt:Hello, island}} Hello, island http://imgs.xkcd.com/comics/island_color.jpg
http://xkcd.com/4 Landscape (sketch) [[A sketch of a landscape with sun on the horizon]] {{Alt: There's a river flowing through the ocea
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@schacon
schacon / classy_git.md
Created November 12, 2010 20:48
RubyConf Talk