Requirements:
If you're on OSX you're probably best off using Homebrew to install this stuff:
$ brew install node mongodb
Usage:
describe ApiWrapper::Connection, "with retry enabled" do | |
before(:each) do | |
# connect to api | |
# the @api_wrapper object persists, across all the responses, and we set the number of retries | |
# on the ApiWrapper::Connection#get method here too, for when we call it further down in the spec. | |
@api_wrapper = ApiWrapper::Connection.new('stage.api_wrapper.com', APIWRAPPER_V2_API_KEY, APIWRAPPER_V2_PASSWORD, :retries => 2) | |
VCR.use_cassette("ApiWrapper_Connection/v2/raising unhandled errors") do |
<?php | |
/** | |
* Implements hook_tokens(). | |
* This is used to insert nodes or node-tokens into content with token_filter, | |
* @see http://drupal.org/node/902244#comment-5616694 | |
*/ | |
function sharpe_tokens($type, $tokens, array $data = array(), array $options = array()) { | |
$replacements = array(); | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bootstrap, from Twitter</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<link href="../assets/css/bootstrap.css" rel="stylesheet"> | |
<style type="text/css"> |
MongoDB provides a Javascript shell. But Javascript is no fun without underscore.js | |
Turned out its straight forward to use underscore.js while scripting mongodb. | |
Here are the steps. | |
1) Use underscore to write your db script file (say my_commands.js) | |
E.g: _.each(db.dbname.find().toArray(), function(itm) { ... }) |
var gulp = require('gulp'); | |
var browserify = require('gulp-browserify'); | |
var concat = require('gulp-concat'); | |
var styl = require('gulp-styl'); | |
var path = require('path'); | |
var o = require('open'); | |
var ripple = require('ripple-emulator'); | |
var webPath = function (p) { return path.join('./www/', p); }; | |
// Builds the scripts based on a single entry point using browserify |
uninstall
JetBrains settings:curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
backup
JetBrains settings:curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-backup.sh | bash -s
I am in the process of building an isomorphic JavaScript framework and I need some help deciding between two options for our templates.
I have two different strategies I am trying to choose between. I have both working and functionally either will be fine, but thing in particular I am trying to think about now is which one would be easier to grok and more accepted by developers/contractors we hire or community members we get to help out on open source pieces.
Note: both options using our jeff.js templating lib which is essentially JavaScript/JSON instead of HTML.
The basic idea here is to have Node functions that are used to either bind data on the server side or generate HTML for the client side. For ex:
import React from 'react'; | |
import Formsy from 'formsy-react'; | |
import ReactSelect from 'react-select'; | |
import './Select.less'; | |
const Select = React.createClass({ | |
mixins: [Formsy.Mixin], |