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
GLOB sdist-make: /home/svenstaro/prj/marshmallow/setup.py | |
py26 create: /home/svenstaro/prj/marshmallow/.tox/py26 | |
ERROR: InterpreterNotFound: python2.6 | |
py27 inst-nodeps: /home/svenstaro/prj/marshmallow/.tox/dist/marshmallow-1.0.1.zip | |
py27 runtests: PYTHONHASHSEED='2556491626' | |
py27 runtests: commands[0] | flake8 . | |
py27 runtests: commands[1] | /home/svenstaro/prj/marshmallow/.tox/py27/bin/python setup.py test | |
running test | |
running egg_info | |
writing top-level names to marshmallow.egg-info/top_level.txt |
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
struct Camera { | |
glm::vec3 pos; | |
glm::vec3 dir; | |
glm::vec3 up; | |
float fov; | |
float near_plane_dist; | |
float far_plane_dist; | |
}; | |
m_camera = Camera{{0, 0, 0}, {0, 1, 0}, {0, 0, 1}, 45.f, 0.1f, 100.f}; |
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
#ifndef TIMER_HPP | |
#define TIMER_HPP | |
#include <chrono> | |
class Timer { | |
public: | |
Timer() { | |
m_start = std::chrono::steady_clock::now(); | |
} |
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
inline bool intersect_ray_aabb(const glm::vec3 &origin, const glm::vec3 &dir, const AABB &aabb) { | |
float tmin, tmax, tymin, tymax, tzmin, tzmax; | |
glm::vec3 bounds[2]; | |
bounds[0] = aabb.min(); | |
bounds[1] = aabb.max(); | |
glm::vec3 invdir = 1.f / dir; | |
glm::i8vec3 sign; |
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
struct Ray { | |
Ray(const glm::vec3 &origin, const glm::vec3 &direction) | |
: m_origin(origin), m_dir(direction), m_invdir(1.f / direction) { | |
} | |
glm::vec3 m_origin; | |
glm::vec3 m_dir; | |
glm::vec3 m_invdir; | |
}; |
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 datetime | |
from sqlalchemy.ext.hybrid import hybrid_property | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://localhost' | |
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False | |
db = SQLAlchemy(app) |
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
*.o | |
*.x |
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
impl<'a, 'r> FromRequest<'a, 'r> for DB { | |
type Error = (); | |
fn from_request(request: &'a Request<'r>) -> request::Outcome<DB, ()> { | |
let pool = match <State<r2d2::Pool> as FromRequest>::from_request(request) { | |
Outcome::Success(pool) => pool, | |
Outcome::Failure(e) => return Outcome::Failure(e), | |
Outcome::Forward(_) => return Outcome::Forward(()), | |
}; |
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
pub fn register(user: Result<UserSerializer, Vec<Value>>, db: DB) -> Result<APIResponse, APIResponse> { | |
if user.is_err() { | |
let error = user.err().unwrap(); | |
return Ok(unprocessable_entity(error)); | |
} | |
let user_data = user.unwrap(); | |
} |
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
#compdef hcloud | |
source <(hcloud completion zsh) |