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
$ -> | |
token = $('meta[name="csrf-token"]').attr('content') | |
$.ajaxPrefilter (options, originalOptions, xhr) -> | |
xhr.setRequestHeader('X-CSRF-Token', token) |
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
Photoset.includes(:photos).where(photos: {photoset_id: nil}) |
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
(Math.random() + 1).toString(36).substring(2); |
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 lsof | grep AppName | grep -v Applications |
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" # По сумме чисел лет |
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
$ 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
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
Backbone.history.loadUrl |