This file contains 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
Instead n queries as: | |
insert into table_name (id, val) values(1,1); | |
insert into table_name (id, val) values(1,2); | |
insert into table_name (id, val) values(1,3); | |
........................................... | |
insert into table_name (id, val) values(1,n); | |
we can do one query as: | |
insert into table_name (id, val) values(1,1),(2,2),(3,3),…(n,n) |
This file contains 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
//****************************************************************************** | |
Функция ЭтоЦифра(стр, позиция=1) | |
Возврат ?(Найти("0123456789", Сред(стр, позиция, 1))>0, 1, 0); | |
КонецФункции | |
//****************************************************************************** | |
Функция EAN13A5CodeGenerate(ШК1) Экспорт | |
ШК=СокрЛП(Прав(ШК1, 5)); | |
Если СтрДлина(Шк)<>5 Тогда | |
Возврат ""; |
This file contains 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
# $:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Для работы rvm | |
require 'rvm' | |
require 'rvm/capistrano' | |
require 'bundler/capistrano' | |
require 'puma/capistrano' | |
set :application, "myapp" | |
set :rails_env, "production" | |
ssh_options[:port] = 777 | |
set :port, 777 |
This file contains 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
context default | |
#========================= | |
# Keywords | |
keyword whole arguments magenta | |
keyword whole break magenta | |
keyword whole caller magenta | |
keyword whole case magenta | |
keyword whole catch magenta | |
keyword whole constructor magenta |
This file contains 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
source 'https://rubygems.org' | |
gem 'puma' | |
gem 'rails' | |
... |
This file contains 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
Процедура СкриптКонтролИнит(scriptCtrl) | |
scriptCtrl = СоздатьОбъект("MSScriptControl.ScriptControl"); | |
scriptCtrl.Language="jscript"; | |
код = " | |
| | |
| function parseJSON(strJSON) { | |
| var tmpFunc = (new Function('return('+strJSON+');'))(); | |
| return(tmpFunc); | |
| } | |
| |
This file contains 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
# html highlighting with tags in caps always. if you want everything in lowercase | |
# use tr | |
# i got upto IMG in the netscape comprehensive tags reference. thereafter will get | |
# done later - paul | |
caseinsensitive | |
context default |
This file contains 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
# iterate 0 to n | |
for e in [0..n] | |
console.log e | |
# iterate in array with element (itm) and index (i) | |
sort_weigth = (arr) -> | |
w = 0 | |
for itm, i in arr | |
w += (itm == 0 ? 0 : 1) * Math.pow(10, arr.length - i) |
This file contains 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
SELECT `db_entity_id`,`role_type_id`,`rights_set`,`parent_id` | |
FROM `db_entity_role_rights` | |
LEFT JOIN `db_entities` | |
ON `db_entity_role_rights`.`db_entity_id`=`db_entities`.`id` |
This file contains 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
f = (x) -> | |
y(x) | |
arr = arr.sort (a, b) -> | |
f(a) - f(b) |
OlderNewer