Command Line
pry -r ./config/app_init_file.rb- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb- load your rails into a pry session
Debugger
Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger
| /* | |
| I wasn't able to find a single example on how to actually use Dapper's new TVP, so I though I'd add one. | |
| First of all, you will need to install the Dapper.TVP package from NuGet. | |
| The main item to note is the need to create and populate a list of SqlDataRecords. This is then used to used as part of the | |
| input parameter for Dapper's TableValueParameter. | |
| The API is thus: |
| var system = require('system'), | |
| env = system.env; | |
| /** | |
| * Wait until the test condition is true or a timeout occurs. Useful for waiting | |
| * on a server response or for a ui change (fadeIn, etc.) to occur. | |
| * | |
| * @param testFx javascript condition that evaluates to a boolean, | |
| * it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or | |
| * as a callback function. |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
#Setting up Nginx on Your Local System ###by Keith Rosenberg
##Step 1 - Homebrew The first thing to do, if you're on a Mac, is to install homebrew from http://mxcl.github.io/homebrew/
The command to type into terminal to install homebrew is:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
| public static class StructureMapDecoratorHelperExtension | |
| { | |
| public static DecoratorHelper<TTarget> Decorate<TTarget>(this SmartInstance<TTarget> instance) | |
| { | |
| return new DecoratorHelper<TTarget>(instance); | |
| } | |
| } | |
| public class DecoratorHelper<TTarget> |
I'm hunting for the best solution on how to handle keeping large sets of DB records "sorted" in a performant manner.
Most of us have work on projects at some point where we have needed to have ordered lists of objects. Whether it be a to-do list sorted by priority, or a list of documents that a user can sort in whatever order they want.
A traditional approach for this on a Rails project is to use something like the acts_as_list gem, or something similar. These systems typically add some sort of "postion" or "sort order" column to each record, which is then used when querying out the records in a traditional order by position SQL query.
This approach seems to work fine for smaller datasets, but can be hard to manage on large data sets with hundreds (or thousands) of records needing to be sorted. Changing the sort position of even a single object will require updating every single record in the database that is in the same sort group. This requires potentially thousands of wri
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
| #!/usr/bin/env bash | |
| uninstall() { | |
| list=`gem list --no-versions` | |
| for gem in $list; do | |
| gem uninstall $gem -aIx | |
| done | |
| gem list | |
| gem install bundler | |
| } |