$ rails g model User
belongs_to
has_one
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 |
using (var repo = new Repository("path\to\repo.git")) | |
{ | |
// Object lookup | |
var obj = repo.Lookup("sha"); | |
var commit = repo.Lookup<Commit>("sha"); | |
var tree = repo.Lookup<Tree>("sha"); | |
var tag = repo.Lookup<Tag>("sha"); | |
// Rev walking | |
foreach (var c in repo.Commits.Walk("sha")) { } |
public class ReducedController : Controller | |
{ | |
private readonly IContainProducts productRepository; | |
private readonly ISearchForProducts productsIndex; | |
private readonly IContainCustomers customerRepository; | |
private readonly IShipProducts productShipper; | |
private readonly ICoordinateSales salesCatalog; | |
public ReducedController( | |
IContainProducts productRepository, |
# Generic build script that builds, tests, and creates nuget packages. | |
# | |
# INSTRUCTIONS: | |
# Update the following project paths: | |
# proj Path to the project file (.csproj) | |
# test Path to the test project (.csproj) | |
# nuspec Path to the package definition for NuGet. | |
# | |
# delete any of the lines if not applicable | |
# |
/* | |
You can now create a spinner using any of the variants below: | |
$("#el").spin(); // Produces default Spinner using the text color of #el. | |
$("#el").spin("small"); // Produces a 'small' Spinner using the text color of #el. | |
$("#el").spin("large", "white"); // Produces a 'large' Spinner in white (or any valid CSS color). | |
$("#el").spin({ ... }); // Produces a Spinner using your custom settings. | |
$("#el").spin(false); // Kills the spinner. |
source "http://rubygems.org" | |
gem "janky", "~>0.9" | |
gem "pg" | |
gem "thin" |
bcx david$ rake stats | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M | | |
+----------------------+-------+-------+---------+---------+-----+-------+ | |
| Controllers | 3704 | 2942 | 72 | 479 | 6 | 4 | | |
| Helpers | 1901 | 1529 | 13 | 261 | 20 | 3 | | |
| Models | 5310 | 4116 | 50 | 653 | 13 | 4 | | |
| Libraries | 2167 | 1593 | 51 | 200 | 3 | 5 | | |
| Integration tests | 297 | 217 | 6 | 1 | 0 | 215 | | |
| Functional tests | 3897 | 3065 | 61 | 11 | 0 | 276 | |
<ol class="wizard-nav"> | |
<li class="done"><a href="#">Step 1</a></li> | |
<li class="done"><a href="#">Step 2</a></li> | |
<li class="active"><a href="#">Step 3</a></li> | |
<li><a href="#" data-disabled>Step 4</a></li> | |
<li><a href="#" data-disabled>Step 5</a></li> | |
</ol> |
/* | |
* CakePHP Twitter Bootstrap Typeahead with id | |
* ProjectsController.php | |
* <?php $this->set('projects', $this->Project->find('list'); $this->render('list', 'ajax'); ?> | |
* /app/View/Projects/list.ctp | |
* <?php echo json_encode($projects); ?> | |
* data = {'id': 'item name', ..}; | |
* /app/View/Tasks/index.ctp | |
* <input type="hidden" id="TaskProjectId" name="data[Task][project_id]"/> | |
* <input autocomplete="off" data-provide="typeahead" class="typeahead" type="search" id="TaskProject"> |