Skip to content

Instantly share code, notes, and snippets.

View jrm2k6's full-sized avatar

Jeremy Dagorn jrm2k6

View GitHub Profile
->tree -L 2
.
├── Procfile
├── README.md
├── app.wsgi.example
├── authentication.py
├── base.py
├── tests
│   ├── __init__.py
│   ├── test_base_bis.py
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] rv = self.handle_user_exception(e)
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] File "/home/jeremydagorn/.virtualenvs/env7/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] reraise(exc_type, exc_value, tb)
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] File "/home/jeremydagorn/.virtualenvs/env7/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] rv = self.dispatch_request()
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] File "/home/jeremydagorn/.virtualenvs/env7/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] return self.view_functions[rule.endpoint](**req.view_args)
[Thu Feb 06 19:39:58 2014] [error] [client 72.220.215.219] File "/home
@jrm2k6
jrm2k6 / gist:8905880
Created February 9, 2014 21:01
Override model views for Flask Admin to not display blank dropdown for models with relationship annotation
#models.py
import sqlalchemy
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import class_mapper, ColumnProperty
db = SQLAlchemy()
class User(db.Model):
(env7)jeremydagorn@ssh:~/www/jeremydagorn-blog$ python
Python 2.7.5 (default, Feb 10 2014, 21:16:24)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>>
jeremydagorn@ssh:~/admin/log$ tail -f error.log
sqlite> SELECT _id, time FROM status WHERE feed_id = 1 ORDER BY time ASC LIMIT 50;
182|1393617844000
192|1393617851000
180|1393618371000
179|1393618444000
175|1393618595000
172|1393618631000
185|1393618732000
181|1393618830000
190|1393618882000
private void displayConversation() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
if (mStatusesList.size() > 1) {
mStatusesList = removeDuplicates(mStatusesList);
}
mStatusAdapter.setStatusesList(mStatusesList);
}
activity nameActivity
extra string 'lol'
extra int 1
import Keyboard
import Window
(gameWidth,gameHeight) = (600,800)
(halfWidth,halfHeight) = (300,400)
type Input = {space:Bool, dir:Int, delta:Time}
type Spaceship = {x:Float, y:Float, rotation:Float}
type Ball = {x:Float, y:Float, vx:Float, vy:Float}
@jrm2k6
jrm2k6 / shoot_the_rectangle.elm
Created April 21, 2014 20:40
shoot the rectangle
import Keyboard
import Window
import Debug
(gameWidth,gameHeight) = (600,800)
(halfWidth,halfHeight) = (300,400)
type Input = {space:Bool, dir:Int, delta:Time}
type Spaceship = {x:Float, y:Float, rotation:Float}
import Keyboard
import Window
import Debug
(gameWidth,gameHeight) = (600,800)
(halfWidth,halfHeight) = (300,400)
type Input = {space:Bool, dir:Int, delta:Time, timestamp:Time}
type Spaceship = {x:Float, y:Float, rotation:Float}