- Go package
- Ruby: script for caching a user's submissions on disk
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
/* | |
This example shows how you can use your data structure as a basis for | |
your Firebase security rules to implement role-based security. We store | |
each user by their Twitter uid, and use the following simplistic approach | |
for user roles: | |
0 - GUEST | |
10 - USER | |
20 - MODERATOR |
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
var App = Ember.Application.create({}); | |
var Promise = Ember.RSVP.Promise; | |
// ADAPTER | |
App.ApplicationAdapter = DS.FirebaseAdapter.extend({ | |
firebase: new Firebase("https://<your-firebase-name>.firebaseio.com/") | |
}); |
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
{ | |
"rules": { | |
".read": true, | |
"articles": { | |
"$article": { | |
"title": { | |
".write": "auth != null", | |
".validate": "newData.isString() && newData.val() != ''" | |
}, | |
"url": { |
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
SELECT | |
COUNT(*) as c, adjective, subject | |
FROM | |
JS( | |
(SELECT tokens FROM [sara-bigquery:syntax.election_tweets]), | |
tokens, | |
"[{ name: 'adjective', type: 'string'}, | |
{name: 'subject', type: 'string'} | |
]", | |
"function(row, emit) { |
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 | |
# SETUP | |
# 1) This requires having SoX (http://sox.sourceforge.net/) installed. On a Mac, you can do this with `brew install sox --with-flac` | |
# 2) You'll also need an API key for your Google Cloud Platform project: https://support.google.com/cloud/answer/6158862 | |
# Create a request file with our JSON request in the current directory | |
FILENAME="request-"`date +"%s".json` | |
cat <<EOF > $FILENAME | |
{ |
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
# Enable Standard SQL to run this query | |
# More on BigQuery here: https://cloud.google.com/bigquery/docs/quickstarts | |
SELECT | |
REGEXP_REPLACE(starttime, '([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})', '\\3-\\1-\\2') as starttime, | |
from_station_lat, | |
from_station_lng | |
FROM `sara-bigquery.nyc_citibike.trips_*` | |
WHERE cast(bikeid as int64) = 17526 # This is the bike with the most trips (found from another query) | |
order by starttime |
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
'use strict'; | |
const fs = require('fs'); | |
const ndjson = require('ndjson'); | |
const request = require('request'); | |
fs.createReadStream('reddit-comments.json') // Newline delimited JSON file | |
.pipe(ndjson.parse()) | |
.on('data', function(obj) { |
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
'use strict'; | |
// Dependencies | |
const gcloud = require('google-cloud', { | |
projectId: 'sara-bigquery', | |
keyfileName: 'keyfile.json' | |
}); | |
const vision = gcloud.vision(); | |
const fs = require('fs'); | |
const async = require('async'); |
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
import * as tf from ‘@tensorflow/tfjs’; | |
const model = tf.sequential(); | |
model.add(tf.layers.dense({inputShape: [4], units: 100})); | |
model.add(tf.layers.dense({units: 4})); | |
model.compile({loss: ‘categoricalCrossentropy’, optimizer: ‘sgd’}); |
OlderNewer