Skip to content

Instantly share code, notes, and snippets.

Adam Zell azell

Block or report user

Report or block azell

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
View merge_git.bash
#!/bin/bash
function avoid_conflict {
if [ -f "$1" ]; then
git checkout "$2"
git mv "$1" "$3/"
git commit -am 'Move file into subdirectory.'
fi
}
View FirebasePush.rb
require 'date'
class FirebasePush
PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz'
def initialize
@prev_ts = 0
@rand_chars = Array.new(12)
end
View Gemfile
gem 'foreman'
gem 'puma'
View DBWrapper.java
public <T> T execute(Function<DSLContext,T> fun) {
T result = null;
Connection connection = null;
DatabaseException userException = null;
try {
connection = dataSource.getConnection();
connection.setAutoCommit(false);
View RxFirebase.java
package com.firebase.client;
import com.firebase.client.core.Constants;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Action0;
import rx.functions.Func1;
import rx.subscriptions.Subscriptions;
public class RxFirebase {
@azell
azell / string-value
Created Dec 2, 2013
Multi-field and string type with embedded value not working as expected
View string-value
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"mappings" : {
"type1" : {
"properties" : {
"name" : {
"type" : "multi_field",
"fields" : {
"name" : {"type" : "string", "index" : "analyzed"},
@azell
azell / string_type
Created Dec 2, 2013
Multi-field and string type working as expected
View string_type
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"mappings" : {
"type1" : {
"properties" : {
"name" : {
"type" : "multi_field",
"fields" : {
"name" : {"type" : "string", "index" : "analyzed"},
View gist:7065868
{
"chat": {
// the list of chats may not be listed (no .read permissions here)
// a chat conversation
"$key": {
// if the chat hasn't been created yet, we allow read so there is a way
// to check this and create it; if it already exists, then authenticated
// user (specified by auth.id) must be in $key/users
View gist:7064193
{
"chat": {
// the list of chats may not be listed (no .read permissions here)
// a chat conversation
"$key": {
// if the chat hasn't been created yet, we allow read so there is a way
// to check this and create it; if it already exists, then authenticated
// user (specified by auth.id) must be in $key/users
View gist:5704171
Tables:
CREATE TABLE "activities" (
"id" INT UNSIGNED NOT NULL AUTO_INCREMENT,
...
);
CREATE TABLE "interests" (
"id" INT UNSIGNED NOT NULL AUTO_INCREMENT,
"name" VARCHAR(255) NOT NULL,
You can’t perform that action at this time.