View gist:55150df8e6d342115494
1 2 3 4 5 6 7 8 9 10
Delivered-To: mehdi.aitoufkir@gmail.com
Received: by 10.64.236.98 with SMTP id ut2csp3291479iec;
Thu, 30 Apr 2015 11:13:53 -0700 (PDT)
X-Received: by 10.107.4.196 with SMTP id 187mr7446259ioe.6.1430417633051;
Thu, 30 Apr 2015 11:13:53 -0700 (PDT)
Return-Path: <pm_bounces@pm.mtasv.net>
Received: from sc-ord-mta118.mtasv.net (sc-ord-mta118.mtasv.net. [50.31.156.118])
by mx.google.com with ESMTPS id m15si1876435igt.42.2015.04.30.11.13.52
for <mehdi.aitoufkir@gmail.com>
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
View gist:edb7b141f2d3f218af17
1 2 3 4 5 6 7 8 9 10
Delivered-To: mehdi.aitoufkir@gmail.com
Received: by 10.64.236.98 with SMTP id ut2csp3287972iec;
Thu, 30 Apr 2015 11:07:36 -0700 (PDT)
X-Received: by 10.236.23.42 with SMTP id u30mr4764701yhu.194.1430417256557;
Thu, 30 Apr 2015 11:07:36 -0700 (PDT)
Return-Path: <marcusmarcus@me.com>
Received: from st11p01mm-asmtp001.mac.com (st11p01mm-asmtp001.mac.com. [17.172.204.239])
by mx.google.com with ESMTPS id uu4si5103474vdc.11.2015.04.30.11.07.36
for <mehdi.aitoufkir@gmail.com>
(version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128);
View gist:6ad15586c3caa2065028
1 2 3
var _ptq = _ptq || []; // define or reuse the queue
// pushing a "purchase" action which will be rewarded only once in a lifetime, this needs to be trigger onload.
_ptq.push(['purchase', {ref_id: <order number>}]);
View gist:b1edd837e34675829b96
1 2 3 4 5 6 7 8 9 10
<script type="text/javascript" charset="utf-8">
var _ptq = _ptq || [];
var _punchtab_settings = {
key: "<YOUR KEY>",
display: "tab",
position: {x:"left", y:"bottom"}
};
(function() {
var pt = document.createElement('script'); pt.type = 'text/javascript'; pt.async = true;
View gist:3824b9576c25d4a04626
1 2 3 4
from django.db import transaction
from django.contrib.sessions.models import Session
Session.objects.filter(expire_date__lt=datetime.datetime.now()).delete()
transaction.commit_unless_managed()
View sql
1
DELETE FROM `django_session` WHERE `session_key` IN ('96ef0d60c319ede132c8de8885f63c5a', '96e4626aa69d9985867ad5514a4c00cc', '96d5188056118a99c13855a7da02d028', '96d254a4813e1fdfe9913b59e65bf85a', '96d22e236088cf93731a827a61bbf6e0', '96c63f7119e82a2ca3729d3ae76d3d51', '96b8996dcf4c192947d7f2e64d4c2476', '96aec7a2bdd47bf4c895bfb7520a9ec0', '96ad2a6caf9243abee04cb49aadbfe8f', '96a626af0581bdfa4e7ce3d26dff80f2', '96a388927a42b1261ca6e1551748ef8f', '96a054fe6ed54db4e3e82dc2a4a3e63c', '969c5830a37344727d90e7d449d5eb19', '969738a65fe61061ddef4818bf3cf73f', '969660ba7c2f1f786136cd43d75b0a87', '969292457c962a0402edaab9056e07fa', '9691309b10360be90830023588ed94c1', '9680c9ce3c8d504d7a6eb42d226d178d', '96808b78ecf93c11a33fd31a6014f5d1', '966f9c2cf56baa92a2e2e982b66d2999', '966d7b13800a9cb3af5c8aefe4d6d460', '966158f2383cd635e299098b382fc40f', '965e0191b1aaa02f19b030bcdf58bfa2', '965025517f804893cd00ddd8ae30f99b', '964afb5803fb57ed7fe5072efd62d776', '962452ea8c07b5ce6caa4ab542af443a', '9612a172041940469c7b537197493a0d',
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
Something went wrong with that request. Please try again.