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
1. Install python3 E.g., apt-get install python3, brew install python3, etc. | |
2. pip3 install twisted | |
3. python3 app.py | |
4. GET localhost:8880 |
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
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Mixpanel.Security { | |
public class MixpanelApiAuthenticator { | |
private const string MIXPANEL_API_SECRET = @"Here's your secret, son"; | |
public string GetAuthenticationUriSubstring(IDictionary<string, string> queryArguments) { |
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 is inside your callbacks, when you have gotten data -- somehow. Replace vars with the correct var names obviously. | |
$scope.combined = $scope.combined.concat(data); | |
$scope.combined = shuffle($scope.combined); | |
// Elsewhere... | |
function shuffle(array) { | |
var currentIndex = array.length | |
,temporaryValue |
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 getReportingYear(reportingGroup, referenceYear) { | |
function rotateCyclicGroup(cyclic, x) { | |
for (var i = 0; i < x; i++) { | |
cyclic.splice(0, 0, cyclic.pop()); | |
} | |
} | |
var cyclicGroup = [0, 1, 2]; | |
switch (referenceYear % 3) { |