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
CREATE OR REPLACE RULE insert_ignore_on_report_types AS | |
ON INSERT TO report_types | |
WHERE EXISTS (SELECT 1 FROM report_types WHERE id = NEW.id) | |
DO INSTEAD NOTHING; | |
INSERT INTO report_types (id, name, system_name, created_at, updated_at) | |
VALUES | |
(20, 'question', 'Иное', now(), now()), | |
(21, 'administration', 'Администрирование образовательной организации', now(), now()), | |
(22, 'administration', 'Проблемы с отчетами и выгрузками', now(), now()), |
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
30 4 * * * /bin/bash -l -c 'RAILS_ENV=production cd /home/errbit/current && rvm 2.2.1 do bundle exec rake custom:delete_old_problems >> log/clear_old_problems.log 2>> log/clear_old_problems.log' |
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
Gem::Specification.find_by_name('GEM_NAME').full_gem_path |
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
xrdb ~/.Xdefaults |
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
# -n - database number | |
redis-cli -n 0 KEYS 'your_pattern*' | xargs redis-cli -n 0 DEL |
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
function coerceToString(val) { | |
return String((val === null || val === undefined) ? '' : val); | |
} | |
var rAmp = /&/g, | |
rLt = /</g, | |
rGt = />/g, | |
rApos = /\'/g, | |
rQuot = /\"/g, | |
hChars = /[&<>\"\']/; |
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
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr |
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
White: | |
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"> | |
Black: | |
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="> |
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
function base64ToBlob(b64String, callback) { | |
var contentType = b64String.split(',')[0].split(':')[1].split(';')[0]; | |
var byteCharacters = atob(b64String.split(',')[1]); | |
var sliceSize = 512; | |
var byteArrays = []; | |
for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) { | |
var slice = byteCharacters.slice(offset, offset + sliceSize); | |
var byteNumbers = new Array(slice.length); | |
for (var i = 0; i < slice.length; i++) { |
NewerOlder