Porting an application across platforms is never particularly easy, nor very interesting. In fact, it's usually a terrible idea: in general, if it ain't broke, don't fix it. But sometimes you have to do it. Maybe a new platform has a feature you believe you can't live without, or the project scope is expanding in directions that make you feel like your original platform choice might not have been the best, or maybe it's just necessary to port for political reasons. Whatever.
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
import unittest | |
from pyramid import testing | |
from paste.deploy.loadwsgi import appconfig | |
from webtest import TestApp | |
from mock import Mock | |
from sqlalchemy import engine_from_config | |
from sqlalchemy.orm import sessionmaker | |
from app.db import Session |
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
vids |
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
# Update System | |
sudo apt-get update && sudo apt-get dist-upgrade | |
# Install prerequisites | |
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev libncurses5-dev zlib1g zlib1g-dev sqlite3 libxslt-dev libxml2-dev libsqlite3-dev python-software-properties postfix curl libcurl3 libcurl3-gnutls libcurl4-openssl-dev | |
# Misc Utilities | |
sudo apt-get install ssh tmux vim git-core wget zip unzip mcrypt imagemagick libmagickwand-dev htop whois dnsutils powertop gparted zenmap terminator | |
# Set up git config |
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
from __future__ import unicode_literals | |
from pyramid.config import Configurator | |
from pyramid.response import Response | |
from pyramid.view import view_config, view_defaults | |
from wsgiref.simple_server import make_server | |
PETS = [ | |
{ |
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
# -*- coding: utf-8 -*- | |
from time import sleep | |
from random import choice | |
import tweepy | |
# The consumer keys can be found on your application's Details | |
# page located at https://dev.twitter.com/apps (under "OAuth settings") | |
CONSUMER_KEY = "" |
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
""" | |
========================================================= | |
Classe ObjetoJS: imitação simples de um objeto JavaScript | |
========================================================= | |
Uma instância é construída passando argumentos nomeados: | |
>>> o = ObjetoJS(z=33, x=11, y=22) | |
A representação textual de uma instância parece a chamada do |
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
package main | |
import ( | |
"fmt" | |
"bytes" | |
"math/rand" | |
"time" | |
) | |
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
from zope import interface | |
from zope import component | |
class ISocket(interface.Interface): | |
pins = interface.Attribute("""pins of socket""") | |
class ISocket2(ISocket): | |
def connect_socket_2_pins(): |