(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// set-up a connection between the client and the server | |
var socket = io.connect(); | |
// let's assume that the client page, once rendered, knows what room it wants to join | |
var room = "abc123"; | |
socket.on('connect', function() { | |
// Connected, let's sign-up for to receive messages for this room | |
socket.emit('room', room); | |
}); |
<?php | |
drupal_add_library('system', 'ui.accordion'); | |
drupal_add_js('jQuery(document).ready(function(){ | |
jQuery("#wrapper").accordion({ | |
header: ".header", | |
autoHeight: false, | |
clearStyle: true, | |
collapsible: true | |
}); |
#!/bin/bash | |
# TO CONFIGURE | |
DRUSH='/usr/local/bin/drush' | |
DUMP_SUBFOLDER='dumps' | |
DUMP_NAME=$1 | |
DRUPAL_ROOT=`$DRUSH st drupal_root --format=list` | |
DRUPAL_CONFIG=`$DRUSH st active_config_directory_path --format=list` | |
DUMP_DIR="$DRUPAL_ROOT/$DUMP_SUBFOLDER/$DUMP_NAME" |
# ignore everything in this directory | |
/* | |
# but not these | |
!.gitignore | |
!assets/ | |
!core/ | |
!_SASS/ | |
!_JS/ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This extension was developed as part of the jsonapi module for Drupal.
The JSON API specification is agnostic about how a server implements filtering strategies. In fact, the spec says:
Note: JSON API is agnostic about the strategies supported by a server. The
filter
query parameter can be used as the basis for any number of filtering strategies.
'use strict' | |
const AWS = require('aws-sdk'); | |
var MongoClient = require('mongodb').MongoClient; | |
let atlas_connection_uri; | |
exports.handler = (event, context, callback) => { | |
var uri = process.env['MONGODB_ATLAS_CLUSTER_URI']; | |
if (atlas_connection_uri != null) { |
Edit: This list is now maintained in the rust-anthology repo.
const ITERS: usize = 20; | |
fn print_fib(n: usize) { | |
let mut x = (1, 1); | |
for i in 0..n { | |
println!("{}: {}", i, x.0); | |
x = (x.1, x.0 + x.1) | |
} | |
} |
function (user, context, callback) { | |
user.app_metadata = user.app_metadata || {}; | |
if ('stripe_customer_id' in user.app_metadata) { | |
context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id; | |
return callback(null, user, context); | |
} | |
var stripe = require('stripe')('sk_....'); | |
var customer = { |