start new:
tmux
start new with session name:
tmux new -s myname
| win.add(createKraWebView({template: "templateexamaple.html",data:{name:"ole",role:"bass",presentation:"<p>Nice guy!</p>"}})); |
| import hmac | |
| import simplejson as json | |
| from base64 import urlsafe_b64decode | |
| from hashlib import sha256 | |
| def parse_signed_request(signed_request, secret): | |
| [encoded_sig, payload] = signed_request.split('.') | |
| # decode data |
| /** | |
| * | |
| * | |
| * Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a> |
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.js'); |
| //npm install b64url | |
| //A signed_request for testing: | |
| //WGvK-mUKB_Utg0l8gSPvf6smzacp46977pTtcRx0puE.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjEyOTI4MjEyMDAsImlzc3VlZF9hdCI6MTI5MjgxNDgyMCwib2F1dGhfdG9rZW4iOiIxNTI1NDk2ODQ3NzczMDJ8Mi5ZV2NxV2k2T0k0U0h4Y2JwTWJRaDdBX18uMzYwMC4xMjkyODIxMjAwLTcyMTU5OTQ3NnxQaDRmb2t6S1IyamozQWlxVldqNXp2cTBmeFEiLCJ1c2VyIjp7ImxvY2FsZSI6ImVuX0dCIiwiY291bnRyeSI6ImF1In0sInVzZXJfaWQiOiI3MjE1OTk0NzYifQ | |
| function parse_signed_request(signed_request, secret) { | |
| encoded_data = signed_request.split('.',2); | |
| // decode the data | |
| sig = encoded_data[0]; | |
| json = base64url.decode(encoded_data[1]); | |
| data = JSON.parse(json); // ERROR Occurs Here! |
| #!/bin/bash | |
| echo "*****************************************" | |
| echo " Add the 10gen repository - after you press" | |
| echo " enter add the following lines and then" | |
| echo " cntl-X to save:" | |
| echo " [10gen]" | |
| echo " name=10gen Repository" | |
| echo " baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64" | |
| echo " gpgcheck=0" | |
| echo "*****************************************" |
| # Extension of http://www.yilmazhuseyin.com/blog/dev/create-thumbnails-imagefield-django/ | |
| # Note: image_folder and thumbnail_folder are both a callable (ie. a lambda that does a '/'.join()) | |
| class Image(Media): | |
| image = models.ImageField( | |
| upload_to=image_folder | |
| ) | |
| thumbnail = models.ImageField( |
| #!/usr/bin/env python | |
| # | |
| from __future__ import with_statement | |
| import os, urllib2, re, base64 | |
| from google.appengine.api import users, images, files | |
| from google.appengine.ext import blobstore, db, webapp | |
| from google.appengine.ext.webapp import blobstore_handlers | |
| from google.appengine.ext.webapp.util import run_wsgi_app |
| import struct | |
| import SocketServer | |
| from base64 import b64encode | |
| from hashlib import sha1 | |
| from mimetools import Message | |
| from StringIO import StringIO | |
| class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
| magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |