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
package android.telephony; | |
import android.os.Bundle; | |
import android.os.Parcel; | |
import android.os.Parcelable; | |
import android.os.Parcelable.Creator; | |
public class SignalStrength | |
implements Parcelable | |
{ |
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
#!/bin/sh | |
# venv_switch.sh | |
# switch between different virtual environments | |
# verify a virtualenv is passed in | |
if [ $# -ne 1 ] | |
then | |
echo 'Usage: venv_switch venv-label' | |
exit -1 | |
fi |
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
source ~/.bashrc | |
source ~/python-projects/virtualenv/activate |
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
from tornado.wsgi import WSGIContainer | |
from tornado.httpserver import HTTPServer | |
from tornado.ioloop import IOLoop | |
from yourapplication import app | |
http_server = HTTPServer(WSGIContainer(app)) | |
http_server.listen(5000) | |
IOLoop.instance().start() |
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
# note that some commands may require root (sudo) in front of them | |
# -- installing python, tornado, flask and related packages -- | |
# install aptitude for better package management (it's just an apt-get wrapper) | |
apt-get install aptitude | |
# install pip to deal with python package installs/updates | |
aptitude install python-pip |
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
/** | |
* Test converting a Java Interface to a Scala Lambda | |
* via implicits. | |
* | |
* @author Wes Lanning | |
* @version 2013-10-12 | |
*/ | |
class ConvertInterfaceTest extends Activity | |
{ | |
// converts Java Runnable implmentation to Scala automagically |
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
from flask import Flask | |
from tornado.web import RequestHandler, Application, FallbackHandler | |
from tornado.wsgi import WSGIContainer | |
from tornado.ioloop import IOLoop | |
from flask_main import app | |
class MainHandler(RequestHandler): | |
""" |
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
import os | |
from redis import StrictRedis | |
from models.user import User | |
import scrypt | |
class UserHelper(object): | |
""" | |
Handles user queries to redis | |
@param redis_connection: |
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
import os | |
from redis import StrictRedis | |
from models.user import User | |
import scrypt | |
class UserHelper(object): | |
""" | |
Handles user queries to redis |
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
# coding=utf-8 | |
import math | |
import os | |
from redis import StrictRedis, WatchError | |
import time | |
import uuid | |
from models.user import User | |
from models.message import Message | |
import scrypt |