Skip to content

Instantly share code, notes, and snippets.

View ivansanchezvera's full-sized avatar

Ivan A Sanchez V ivansanchezvera

View GitHub Profile
@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@brantfaircloth
brantfaircloth / mpi_file_passing.py
Created April 13, 2012 19:43
mpi4py "file-passing" scatter/gather example
import os
import tempfile
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
mode = MPI.MODE_RDONLY
@devsprint
devsprint / gist:5363023
Last active November 3, 2020 02:51
Write a blob content to Cassandra using datastax\java-driver
private static String WRITE_STATEMENT = "INSERT INTO avatars (id, image_type, avatar) VALUES (?,?,?);";
private final BoundStatement writeStatement=writeStatement = session.prepare(WRITE_STATEMENT)
.setConsistencyLevel(ConsistencyLevel.LOCAL_QUORUM).bind();
try {
BoundStatement stmt = driver.getWriteStatement();
stmt.enableTracing();
stmt.setLong("id", accountId);
stmt.setString("image_type", image.getType());
stmt.setBytes("avatar", ByteBuffer.wrap(image.getBytes()));
@nghuuphuoc
nghuuphuoc / 1) Install
Last active September 4, 2023 09:29
Install Redis on Centos 6
// --- Compiling ---
$ wget http://download.redis.io/releases/redis-2.8.3.tar.gz
$ tar xzvf redis-2.8.3.tar.gz
$ cd redis-2.8.3
$ make
$ make install
// --- or using yum ---
$ rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
  1. Getting Started ==================

This getting started guide acts as a foundational introduction into the Couchbase Java SDK. You learn how to install it properly and write a basic sample application that highlights important aspects. At the end of this guide you are able to start exploring further documentation on your own or proceed with a tutorial where a full-blown, production grade application is built.

2.a Installation

Currently, the Java SDK is in a beta release state, so you need to include the Couchbase Maven Repository if you want to pull it in automatically. Here is a typical pom.xml that you can copy and paste:

#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis/redis.pid
@daschl
daschl / gist:db9fcc9d2b932115b679
Last active August 26, 2020 23:17
Draft: Writing Code for Production

Writing Resilient Reactive Applications

This guide is a first draft (that will end up in the official docs) on writing resilient code for production with the Couchbase Java SDK. At the end, the reader will be able to write code that withstands bugs, latency issues or anything else that can make their application fail.

Note that lots of concepts can be applied for both synchronous and asynchronous access. When necessary, both patterns are discussed separately. Also, the focus is on database interaction, but if you are using RxJava as part of your stack you can apply most of the principles there as well (and should!).

RxJava 101 Recap: Cold and Hot Observables

When working with Observables, it is important to understand the difference between cold and hot. Cold Observables will start to emit events once a Observer subscribes, and will do it "fresh" for each Observer. Hot Observables instead are starting to emit data as soon as it becomes available, and will return the same (or parts of the same)

@daschl
daschl / talks.md
Last active August 29, 2015 14:10
Me talking.

Conference Talks

2014

  • Span 2014, London: Building a Reactive Database Driver on the JVM [Slides]
  • Couchbase Connect 2014, San Francisco: Reactive Programming with RxJava for Efficient Data Access [Slides] [Recording]
  • Couchbase Connect 2014, San Francisco: Native APIs for Querying Couchbase Server with N1QL [Slides] [Recording]
  • SpringOne 2014, Dallas: Couchbase and SpringData in the Enterprise [Slides] [Recording]
  • JAX 2014, Mainz: **State
@bonzanini
bonzanini / config.py
Last active April 18, 2024 11:57
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
@maxirosson
maxirosson / build.gradle
Last active December 28, 2022 12:02
Versioning Android apps
apply plugin: 'com.android.application'
ext.versionMajor = 1
ext.versionMinor = 2
ext.versionPatch = 3
ext.versionClassifier = null
ext.isSnapshot = true
ext.minimumSdkVersion = 19
android {