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
class Cart | |
include ActiveAttr::Model | |
attribute :items # has_many | |
attribute :qty, :type => Integer | |
attribute :subtotal_chf, :type => Integer | |
attribute :subtotal_eur, :type => Integer | |
attribute :order_id, :type => Integer | |
def initialize(storage) |
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
update pg_database set datallowconn = 'false' where datname = 'dbname'; | |
DROP DATABASE 'dbname' |
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
# start on task | |
git checkout dev | |
git pull | |
git checkout -b branchname | |
# work & commit | |
# send to central repo everyday | |
git push origin branchname |
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
git rm --cached file_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
Backbone.history.loadUrl |
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
initdb /usr/local/var/postgres -E utf8 # create a database cluster | |
postgres -D /usr/local/var/postgres # serve that database | |
PGDATA=/usr/local/var/postgres postgres # …alternatively | |
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To migrate existing data from a previous major version (pre-9.3) of PostgreSQL, see: | |
http://www.postgresql.org/docs/9.3/static/upgrading.html |
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
$ brew install openssl readline | |
$ CONFIGURE_OPTS="--with-openssl-dir=`brew --prefix openssl` --with-readline-dir=`brew --prefix readline`" rbenv install 2.0.0-p353 |
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
postgres=# create extension if not exists postgis; | |
ERROR: could not load library "/usr/local/Cellar/postgresql/9.3.2/lib/rtpostgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.3.2/lib/rtpostgis-2.1.so, 10): Library not loaded: /usr/local/opt/sqlite/lib/libsqlite3.0.8.6.dylib | |
Referenced from: /usr/local/lib/libspatialite.5.dylib | |
Reason: image not found | |
# Solution is to create symlink to sqlite with "the right" name | |
ln -s /usr/local/opt/sqlite/lib/libsqlite3.0.dylib /usr/local/opt/sqlite/lib/libsqlite3.0.8.6.dylib |
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
# | |
# @author Vladimir E <[email protected]> | |
# | |
class Finliner.Models.AmortizationCalculator extends Finliner.Models.BaseModel | |
available_methods: [ | |
"linear_period" # Линеийный способ (от срока) | |
"linear_percent" # Линеийный способ (от процента) | |
"residual_reducing" # Способ уменьшения остатка | |
"years_amount" # По сумме чисел лет |