Authenticate with an email and password to receive a session_token
.
The Session Token will be a top level key called token
.
The Session Token token
is used for all requests after authentication.
You also receive a user_id
which is used in your apps and keys lookup.
This file contains hidden or 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
// | |
// ** ** | |
// ** Add your API Key to MY SECRETS (Left Panel) ** | |
// ** ** | |
// ** HUGGINGFACE_API_KEY as the Secret Name ** | |
// ** ** | |
// | |
let HUGGINGFACE_API_KEY = null; | |
function getAPIKey() { | |
// Use cached key |
This file contains hidden or 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
----------------------- SimpleAggregateFunction + groupArrayArray ---------------------------- | |
drop table if exists states_raw; | |
drop table if exists final_states_by_month; | |
drop table if exists final_states_by_month_mv; | |
CREATE TABLE states_raw(d date, uid UInt64, s String) ENGINE = Null; | |
CREATE TABLE final_states_by_month(d date, uid UInt64, a_state SimpleAggregateFunction(groupArrayArray, Array(String))) | |
ENGINE = AggregatingMergeTree PARTITION BY toYYYYMM(d) ORDER BY (uid); |
Why would you want to do this? Because you often don't need more. It's nice to not have to think about your "router" as this big special thing.
Instead, with this approch, your app's current pathname
is just another piece of state, just like anything else.
This also means that when doing server-side rendering of a redux app, you can just do:
var app = require('your/redux/app')
var React = require('react')
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Net; | |
using System.Reactive.Linq; | |
using System.Reflection; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
Setup vagrant vm
vagrant box add precise64 http://files.vagrantup.com/precise64.box
vagrant init precise64
sed -i 's/# config.vm.network :hostonly/config.vm.network :hostonly/' Vagrantfile
vagrant up
vagrant ssh
Install base software and apache (to have something to proxy)
This file contains hidden or 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 static class Wait | |
{ | |
public static bool ForExpectedValue<T>(T expectation, Func<T> source, int millisecondPolling = 500, int timeoutInMilliseconds = 5000) | |
{ | |
var matched = Wait.Until(() => expectation.Equals(source()), millisecondPolling, timeoutInMilliseconds).WasSatisfied; | |
StoryTellerAssert.Fail(!matched, () => "Expected {0}, but was {1}".ToFormat(expectation, source())); | |
return true; | |
} |
This file contains hidden or 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
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/ | |
$subscription = "[Your Subscription Name]" | |
$service = "[Your Azure Service Name]" | |
$slot = "staging" #staging or production | |
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg" | |
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg" | |
$timeStampFormat = "g" | |
$deploymentLabel = "ContinuousDeploy to $service v%build.number%" | |
Write-Output "Running Azure Imports" |
This file contains hidden or 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
while (_isRunning) | |
{ | |
try | |
{ | |
if (channel == null || consumer == null) | |
{ | |
try | |
{ | |
_connection = factory.CreateConnection(); | |
channel = _connection.CreateModel(); |
This file contains hidden or 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
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
# | |
# Deployment structure | |
# | |
# SERVER: | |
# /etc/init.d/nginx (1. nginx) | |
# /home/app/public_html/app_production/current (Capistrano directory) | |
# |
NewerOlder