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
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list | |
sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner" -y | |
sudo add-apt-repository ppa:git-core/ppa -y | |
sudo add-apt-repository ppa:tycho-s/ppa -y | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
sudo apt-get install libcurl4-openssl-dev -y | |
sudo apt-get install libssl-dev -y |
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
upstream backend { | |
server 127.0.0.1:5000; | |
} | |
server { | |
listen 80; | |
root /ray/ray/yapp; | |
index yapp.html; | |
server_name _; |
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
server { | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/example.log; | |
location / { | |
proxy_pass http://backend; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; |
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
server { | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/example.log; | |
location / { | |
proxy_pass http://backend; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; |
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
server { | |
listen 80; | |
server_name localhost; | |
access_log /var/log/nginx/example.log; | |
location / { | |
proxy_pass http://backend; | |
proxy_redirect off; | |
proxy_set_header X-Real-IP $remote_addr; |
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 cairocffi as cairo | |
import pango | |
import pangocairo | |
import glib | |
import gobject | |
import pygtk | |
WIDTH, HEIGHT = 256, 256 | |
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT) |
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 web, sys, os, subprocess, uuid | |
from opencv.cv import * | |
from opencv.highgui import * | |
from shutil import copy | |
def detectObjects(image, imagefile): | |
grayscale = cvCreateImage(cvSize(image.width, image.height), 8, 1) | |
cvCvtColor(image, grayscale, CV_BGR2GRAY) | |
storage = cvCreateMemStorage(0) |
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
// 32 bit image | |
typedef struct { | |
int width, height; | |
int** data; | |
} RBitmap; | |
int write_truecolor_tga( RBitmap* data ) { | |
FILE *fp = fopen("out.tga", "w"); | |
if (fp == NULL) return 0; | |
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 pygame | |
import math | |
def findnoise2(x,y): | |
n = int(x) + int(y) * 57 | |
allf = 0xFFFFFFFF | |
an = (n << 13) & allf | |
n = (an ^ n) & allf | |
nn = (n*(n*n*60493+19990303)+1376312589)&0x7fffffff | |
return 1.0-(float(nn)/1073741824.0); |
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 pygame | |
from collections import defaultdict | |
levelmap = defaultdict(dict) | |
class Player(pygame.sprite.Sprite): | |
def __init__(self, level): | |
pygame.sprite.Sprite.__init__(self) | |
self.image = pygame.Surface((10,10)) | |
self.image.fill((40,50,170)) |