Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):
class Shop extends Eloquent {}
Using custom table name
protected $table = 'my_shops';
| from bisect import bisect_left | |
| from sys import stdin | |
| def is_palin(n): | |
| s = str(n) | |
| return s == s[::-1] | |
| def fair(n): | |
| return is_palin(n) and is_palin(n**2) |
| def convert_rt90_to_wgs84(geopos) | |
| # from http://mellifica.se/geodesi/gausskruger.js | |
| geopos=geopos.first | |
| x = geopos['x'].to_i | |
| y = geopos['y'].to_i | |
| axis = 6378137.0 # GRS 80. | |
| flattening = 1.0 / 298.257222101 # GRS 80. | |
| central_meridian = 15.0 + 48.0/60.0 + 22.624306/3600.0 |
| I've tried now for several hours understanding how to use Git with webfaction. | |
| And even with the documentation I cannot get it to work. | |
| I have a Django app at: webapps/django_app/project_name/ | |
| I have a Git repo at: webapps/git_app/repos/my_repo.git | |
| I assume the following workflow: | |
| Make som local changes |
| // Usage example: | |
| // input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png | |
| // | |
| // UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]]; | |
| // .h | |
| @interface UIImage (IPImageUtils) | |
| + (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color; | |
| @end |
| <!DOCTYPE html> | |
| <head> | |
| <title>Stay Standalone</title> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
| <script src="stay_standalone.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <ul> | |
| <li><a href="http://google.com/">Remote Link (Google)</a></li> |
| from django.contrib.sessions.backends.base import SessionBase, CreateError | |
| from django.conf import settings | |
| from django.utils.encoding import force_unicode | |
| import redis | |
| class SessionStore(SessionBase): | |
| """ Redis store for sessions""" | |
| def __init__(self, session_key=None): | |
| self.redis = redis.Redis( |
In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.
For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.