Skip to content

Instantly share code, notes, and snippets.

Rebecca Mills beccam

  • NL, Canada
Block or report user

Report or block beccam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beccam
beccam / quickstart.c
Last active Jul 17, 2019
A basic C demo CRUD application using the DataStax C/C++ Driver for Apache Cassandra.
View quickstart.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cassandra.h>
struct Users_ {
const char* lastname;
cass_int32_t age;
const char* city;
@beccam
beccam / quickstart.cpp
Created Jul 9, 2019
A basic C++ demo CRUD application using the DataStax C/C++ Driver for Apache Cassandra
View quickstart.cpp
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cassandra.h"
struct Users_ {
const char* lastname;
cass_int32_t age;
@beccam
beccam / quickstart.js
Last active May 31, 2019
Demo CRUD application with Node.js
View quickstart.js
const cassandra = require('cassandra-driver');
// TO DO: Fill in your own host and data center
const client = new cassandra.Client({
contactPoints: ['127.0.0.1'],
localDataCenter: 'datacenter1',
keyspace: 'demo'
});
function insertUser(lastname, age, city, email, firstname) {
@beccam
beccam / quickstart.py
Last active May 30, 2019
A basic Python demo CRUD application using the DataStax Python Driver for Apache Cassandra.
View quickstart.py
from cassandra.cluster import Cluster
def create_connection():
# TO DO: Fill in your own contact point
cluster = Cluster(['127.0.0.1'])
return cluster.connect('demo')
def set_user(session, lastname, age, city, email, firstname):
# TO DO: execute SimpleStatement that inserts one user into the table
session.execute("INSERT INTO users (lastname, age, city, email, firstname) VALUES (%s,%s,%s,%s,%s)", [lastname, age, city, email, firstname])
@beccam
beccam / Program.cs
Last active May 25, 2019
A basic C#/.NET demo CRUD application using the DataStax C# Driver for Apache Cassandra.
View Program.cs
using Cassandra;
using System.Linq;
using System;
namespace QuickStart
{
class Program
{
static void Main(string[] args)
{
View GettingStarted.java
package com.datastax.quickstart;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.cql.*;
import java.net.InetSocketAddress;
public class GettingStarted {
public static void main(String[] args) {
@beccam
beccam / GettingStartedTwo.php
Last active Aug 29, 2015
GettingStartedTwo
View GettingStartedTwo.php
<?php
$cluster = Cassandra::cluster()
->withPersistentSessions(true)
->withTokenAwareRouting(true)
->build();
$keyspace = 'killrvideo';
$session = $cluster->connect($keyspace);
@beccam
beccam / GettingStarted.php
Created May 26, 2015
Getting Started with Apache Cassandra and PHP
View GettingStarted.php
<?php
$cluster = Cassandra::cluster()
->build();
$keyspace = 'killrvideo';
$session = $cluster->connect($keyspace);
$statement = $session->execute(new Cassandra\SimpleStatement(
"INSERT INTO users (userid, created_date, email, firstname, lastname) VALUES (14c532ac-f5ae-479a-9d0a-36604732e01d, '2013-01-01 00:00:00', 'luke@example.com','Luke','Tillman')"
));
$result = $session->execute(new Cassandra\SimpleStatement("SELECT firstname, lastname, email FROM killrvideo.users WHERE userid=14c532ac-f5ae-479a-9d0a-36604732e01d"));
@beccam
beccam / GettingStarted.js
Last active Feb 15, 2018
Getting Started with Apace Cassandra and the Datastax Node.js Driver
View GettingStarted.js
var cassandra = require('cassandra-driver');
var async = require('async');
var client = new cassandra.Client({contactPoints: ['127.0.0.1'], keyspace: 'demo'});
// Use async series to run functions in serial (one after another)
async.series([
// Insert Bob
function (callback) {
client.execute("INSERT INTO users (lastname, age, city, email, firstname) VALUES ('Jones', 35, 'Austin', 'bob@example.com', 'Bob')", function (err, result) {
@beccam
beccam / getting_started.rb
Created Sep 20, 2014
Getting Started with Apache Cassandra and the DS Ruby Driver
View getting_started.rb
require 'cassandra'
cluster = Cassandra.connect
#cluster.each_host do |host|
# puts "Host #{"127.0.0.1"}: id=#{"6123e2c1-e3ca-4d08-a544-1315b2f399f1"} datacenter=#{"datacenter1"} rack=#{"rack1"}"
#end
keyspace = 'demo'
session = cluster.connect(keyspace)
You can’t perform that action at this time.