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 asyncio | |
import streamlit as st | |
from httpx_oauth.clients.google import GoogleOAuth2 | |
st.title("Google OAuth2 flow") | |
"## Configuration" | |
client_id = st.text_input("Client ID") |
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
// transcribed from an Apache Spark 1.0 spark-shell session | |
// using data from http://chriswhong.com/open-data/foil_nyc_taxi/ | |
// and the QTree algorithm for approximate quantiles over large datasets | |
// each of the distanceRange and minutesRange calculations below takes about 15 minutes on my four-core SSD-based Macbook Pro | |
import com.twitter.algebird._ | |
import com.twitter.algebird.Operators._ | |
implicit val qtSemigroupD = new QTreeSemigroup[Double](6) | |
val in = sc.textFile("trip_data") // a directory containing all the trip_data*.csv files downloaded from the above link |
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 'ffi' | |
# A MIDI driver to play MIDI using OSX's built in DLS synthesizer. | |
# | |
# == Authors | |
# | |
# * Adam Murray <[email protected]> | |
# | |
# == Copyright | |
# |
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 GIST IS OUT OF DATE AND NOT MONITORED | |
PLEASE SEE https://github.com/leecrossley/cordova-plugin-shake-detection | |
*/ | |
var shake = (function () { | |
var shake = {}, | |
watchId = null, | |
options = { frequency: 300 }, | |
previousAcceleration = { x: null, y: null, z: null }, |
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
function createDimensions(key) { | |
var asc = xf.dimension(function (d) { return +(d[key]) }) | |
var desc = xf.dimension(function (d) { return -1 * (+(d[key])) }) | |
var sorter = new BucketSort(+(desc.top(1)[0][key]), +(asc.top(1)[0][key]), 100) | |
var buckets = xf.dimension(function (d) { return sorter.getBucket(+d[key]) }) | |
var group = buckets.group() | |
return { | |
asc: asc, | |
desc: desc, | |
buckets: buckets, |