#Unix Toolbox
##Unix Toolbox revision 14.4
Error reports and comments are m
#Unix Toolbox
##Unix Toolbox revision 14.4
| #!/usr/bin/env ruby | |
| # make sure you the watir gem installed -> gem install watir | |
| require 'watir' | |
| def log (message) puts " #{message}" end | |
| def success (message) puts "+ #{message}" end | |
| def fail (message) puts "- #{message}" end | |
| def notify (message) | |
| success message.upcase | |
| system 'osascript -e \'Display notification Burgerbot with title "%s"\'' % message | |
| rescue StandardError => e |
Function type is useful:
Notice that the interface shape only defines the type of function
| def break_even(long_sp, short_sp, ndp) | |
| if long_sp > short_sp # bear option | |
| long_sp - ndp | |
| else # bull option | |
| long_sp + ndp | |
| end | |
| end | |
| def max_profit(long_sp, short_sp, ndp) | |
| if(long_sp > short_sp) # bear option |
| # adding a column to an existing table | |
| rails g migration AddNameToUsers name:string | |
| # or | |
| rails generate migration add_image_to_pictures image_id:string | |
| # to remove | |
| rails d migration AddNameToUsers name:string | |
| # remove column from model | |
| rails g migration RemoveProjectIDFromProjects project_id:string |
آسمان رنگ تو آبی آبی
آسمان دریای پر ز آبی
چه بگویم ز ستاره گانت
که خودت کشور آفتابی
آسمان عاشق مهتابی تو و
| [ | |
| { | |
| "lead": { | |
| "id": 299888, | |
| "trade_id": 6, | |
| "details": { | |
| "project_deadline": "So schnell wie möglich" | |
| }, | |
| "closed_at": null, | |
| "expiration_date": "2018-12-13T01:22:19.000+01:00", |
# start postgresql
/usr/lib/postgresql-9.0/bin/postgres -D /var/lib/postgresql/9.1/boom/ -c config_file=/etc/postgresql-9.0/postgresql.conf
#
# #psql dump:
pg_dump #host localhost #port 5555 #username "foo" #format tar #blobs #verbose #file "/home/tokhi/Documents/Castaclip/castaclip.master.130612.tmp" "verticals"
# # restore:Elasticsearch is a real time search engine where a change to an index will be propegated to the whole cluster within a second.
An elasticsearch cluster indicated as one or more nodes, collection of nodes containing all the data, default cluster name is elasticserach.
A node is a single server and part of a cluster, node participate in searching and indexing.
Index is collection of documents equavalent to a database within a relational system, index name must be lowercase
Type is represetn a class = table