This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function avoid_conflict { | |
if [ -f "$1" ]; then | |
git checkout "$2" | |
git mv "$1" "$3/" | |
git commit -am 'Move file into subdirectory.' | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
class FirebasePush | |
PUSH_CHARS = '-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz' | |
def initialize | |
@prev_ts = 0 | |
@rand_chars = Array.new(12) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'foreman' | |
gem 'puma' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public <T> T execute(Function<DSLContext,T> fun) { | |
T result = null; | |
Connection connection = null; | |
DatabaseException userException = null; | |
try { | |
connection = dataSource.getConnection(); | |
connection.setAutoCommit(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE localhost:9200/test | |
curl -XPUT localhost:9200/test -d '{ | |
"mappings" : { | |
"type1" : { | |
"properties" : { | |
"name" : { | |
"type" : "multi_field", | |
"fields" : { | |
"name" : {"type" : "string", "index" : "analyzed"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE localhost:9200/test | |
curl -XPUT localhost:9200/test -d '{ | |
"mappings" : { | |
"type1" : { | |
"properties" : { | |
"name" : { | |
"type" : "multi_field", | |
"fields" : { | |
"name" : {"type" : "string", "index" : "analyzed"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
NewerOlder