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
| ## | |
| # MonkeyPatch roundHalfToEven (Banker round) | |
| # | |
| # Solve most of floating binary point problems, and round | |
| # to the specified decimal using banker round for financial | |
| # calculations. Half fraction between number are rounded to | |
| # the nearest even number. | |
| # | |
| # @author Jeremy Trufier <[email protected]> | |
| # @copyright Storific 2012 |
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
| #!/bin/bash | |
| # Configuration (to edit) | |
| RCPATH=~/.bashrc | |
| PROJECT_DIRECTORY=~/Sites/myproject # project directoy (if it doesn't exist, the project will be installed here) | |
| PROJECT_GIT_REPOSITORY='[email protected]:myname/myproject.git' # git repository of the project | |
| DBPASS='123456' # root pass | |
| # Your current Rails configuration (fill it with config/database.yml) | |
| RAILS_BASE='myproject_dev' |
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
| # Optimised if the BASE array has the same size as a power of 2, otherwise disable symetrie | |
| # Optimised if 0 is the first in the BASE array | |
| BASE_2 = ['0','1'] | |
| BASE_4 = ('0'..'3').to_a | |
| BASE_8 = ('0'..'7').to_a | |
| BASE_16 = ('0'..'9').to_a + ('a'..'f').to_a | |
| BASE_32 = ('0'..'9').to_a + ('a'..'v').to_a | |
| BASE_64 = ('0'..'9').to_a + ('a'..'z').to_a + ('A'..'Z').to_a + ['$','_'] | |
| SHUFFLE_BASE_16 = ['0','4','2','1','8','6','7','5','9','3','c','b','a','f','d','e'] | |
| SHUFFLE_BASE_64 = ['0','7','S','q','j','6','N','C','u','8','W','k','4','J','K','5','m','1','F','f','D','X','g','V','n','z','B','i','L','P','l','a','G','s','Q','2','Z','d','v','o','I','x','_','M','Y','c','9','h','$','R','b','U','y','O','A','w','e','p','3','T','E','H','t','r'] |
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
| ## | |
| # MonkeyPatch crypt_id | |
| # | |
| # Provide an efficient way to crypt an id, with | |
| # different possibility for each id. | |
| # | |
| # Three provided methods are: | |
| # Int.crypt_id(key='') | |
| # String.decrypt_id(key='') | |
| # String.change_charset(charset_from, charset_to) |
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
| ### | |
| # I18n class | |
| # Allow you to add Internationalization to your CoffeeScript application | |
| # | |
| # Just call it with a `require 'util/I18n'` or `new I18n` if you don't have a `require` system | |
| # More informations here: https://github.com/Tronix117/tradify | |
| # Translation files should be saved in `locales/{langage code}.coffee` | |
| # | |
| # Then you can translate everything with `tr('{0} day', numberOfDay)` | |
| # |
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
| ### | |
| # Cakefile | |
| # | |
| # Build easily Stylus, CoffeeScript and Jade source files | |
| # for little projects. | |
| # | |
| # First install requirements using `npm install` | |
| # | |
| # Then, modify the config in the `config.coffee` file | |
| # |
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
| ### | |
| # Adding relation support to models | |
| Note: Given collections were here Singletons in this project, you can also use instances of collections instead. | |
| relations: | |
| friends: require 'collections/Users' # @get('friends') will return an array of friend if friends_ids or friends_id is an array | |
| store: require 'collections/Store' # @get('store') will return the store object if there is a store_id | |
| subcategories: | |
| through: 'category_ids' |
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
| #!/bin/sh | |
| PHONE=${2-yourdefaultphonenumber} | |
| CODE=$1 | |
| OUTPUT=${3-.} | |
| BASEURL=http://www.lire-mms.bouyguestelecom.fr/mmbox | |
| SESSIONID=`curl -s -X POST -d "msisdn=$PHONE&msgid=$CODE" -D- "$BASEURL/otp.html" -o /dev/null | grep JSESSIONID | cut -d'=' -f2 | cut -f1 -d' ' | tr "\!" "\\\!"` |
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
| # Saferize Click | |
| # | |
| # saferClick = saferizeClick singleClickCallback, doubleClickCallback | |
| # | |
| # Prevent 'click' callback to be called when 'dblClick' callback should be called | |
| # | |
| # Exemple: | |
| # | |
| # Better to add it to underscore with following: | |
| # |
OlderNewer