mehdi ait oufkir mehdimehdi

View gist:8482929
1 2 3 4 5 6 7 8 9
Build a command line tool which takes a CSV file-like input, and creates an histogram in ASCII
 
data = [(0,1),
(2, 4),
(4, 2),
(3, 3)]
 
 
Each row in the CSV is data which helps build the histogram. The first value is the column #, the second value is the value of bar in the histogram.
View sso-login.html
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE HTML>
<html>
<body>
<script>
var _pt_pre_config = {
auth_request: "eyJpZCI6IjIiLCJmaXJzdF9uYW1lIjoiSm9obiIsImxhc3RfbmFtZSI6IkRvZSIsImVtYWlsIjoiam9obi5kb2VAZXhhbXBsZS5uZXQiLCJhdmF0YXJfbGluayI6Imh0dHA6XC9cL3MzLmFtYXpvbmF3cy5jb21cL3B1bmNodGFiLXN0YXRpY1wvenp6enp6XC9pbWdcL3RlYW1cL2xld29sZi5qcGcifQ==",
signature: "9660b0ea6c6abc916ea055a6fdd12c76cb3a4dfb",
timestamp: "1389384230",
client_id: "2128281015"
};
View sso-login.php
1 2 3 4 5 6 7 8 9
<?php
define ('PUNCHTAB_CLIENT_ID', '2128281015'); //client_id
define ('PUNCHTAB_SECRET_KEY', '< YOUR SECRET KEY >');
define ('PUNCHTAB_ACCESS_KEY', 'c370b56450e41a8f689fffb2374e7ef4'); //key
 
$user = array('id' => '2', 'first_name' => 'John', 'last_name' => 'Doe', 'email' => 'john.doe@example.net', 'avatar_link' => 'http://s3.amazonaws.com/punchtab-static/zzzzzz/img/team/lewolf.jpg');
$auth_request = base64_encode(json_encode($user));
$timestamp=time();
$signature = hash_hmac('sha1', "$auth_request $timestamp", PUNCHTAB_SECRET_KEY);
View sso-login.py
1 2 3 4 5 6 7 8 9 10
import requests
import base64
import hashlib
import hmac
import simplejson
import time
 
PUNCHTAB_CLIENT_ID = '2128281015' #client_id
PUNCHTAB_SECRET_KEY = '<YOUR SECRET KEY>'
PUNCHTAB_ACCESS_KEY = 'c370b56450e41a8f689fffb2374e7ef4' #key
View login-status
1 2 3 4
$curl "https://api.punchtab.com/v1/auth/status?token=ll&key=c370b56450e41a8f689fffb2374e7ef4"
{
"status": "disconnected"
}
View clean.js
1 2 3 4 5 6 7 8 9 10
//getting the punchtab db to do the real db operations..
var punchtabDb = db.getSiblingDB('punchtab');
 
//the date to start from
var oldestDoc = punchtabDb.track.find({},{date_created:1}).sort({date_created : 1}).limit(1).toArray()[0];
var someOldDate = oldestDoc['date_created'];
 
var sleepAmount = 10 * 1000; //ten second
 
var failSafeDate = new Date(2013,05,13);
View gist:7013024
1 2 3 4 5
PT.event.bind('main.comment', function (response) {
if (response && response.commentID) {
_ptq.push(['review', {points: 100, ref_id: response.commentID}]);
}
});
View gist:6731916
1 2 3 4 5 6 7 8 9 10
# upload /Users/mehdi/Documents/attila ssh://dotcloud@uploader.dotcloud.com:443/analytics
# git
Warning: Permanently added '[uploader.dotcloud.com]:443,[23.21.128.228]:443' (RSA) to the list of known hosts.
Everything up-to-date
17:13:58 ---> Deploy of "analytics" scheduled for revision git-574d320 at 2013-09-27 17:13:58
17:13:58 ---> Building the application...
17:13:58 [extract] Build started for revision git-574d320-1 (clean build)
17:14:01 [extract] I am snapshotsworker_02/ec2-184-73-114-244, and I will be your builder today.
17:14:03 [extract] stdin: is not a tty
17:14:03 [extract] Get:1 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid Release.gpg [189B]
View gist:6502903
1 2 3
 
var connectButton = PT.dom.$("connect-button");
PT.widget.connect.attachConnect(connectButton);
View gist:6500841
1 2 3 4 5 6
window.ptReady = window.ptReady || [];
window.ptReady.push(function(){
PT.event.bind('user.connected', function(event){
console.log(event.accessToken);//<- this is the token you need to call our API
});
});
Something went wrong with that request. Please try again.