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 | |
# Создаем файл .git/hooks/commit-msg и сохраняем туда этот текст | |
# Не забываем дать права на выполнение этого файла $ chmod 777 .git/hooks/commit-msg | |
# создаем временный файл | |
tempname="ticket-id-XXXX"; | |
tempfile=`mktemp $tempname`; | |
# выделяем из имени бранча номер тикета. Бранч всегда называется по шаблону Номер_Краткое_Описание | |
# например 1364_restore_xterm_title или 1364-restore-xterm-title |
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
<form id="cardentry" action="/ecomm2/ClientHandler" method="post" autocomplete="off"> | |
<p id="transaction_props"> | |
<input type="hidden" name="trans_id" value="sspQw95II/I5KoQqBs8ufWGcHS0=" readonly="readonly" /> | |
<input type="hidden" name="count" value="1" readonly="readonly" /> | |
</p> | |
<div class="card_input"> | |
<input type="hidden" name="cardname" value="RSEXPRESS CARDTOCARD"> | |
<input id="cardnr" type="text" name="cardnr" autocomplete="off" size="19" maxlength="19" /> | |
<input id="cardnr2" type="text" name="cardnr2" autocomplete="off" size="19" maxlength="19" /> |
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
var MyModal = function() { | |
var $elem, options, Modal; | |
Modal = $.fn.modal.Constructor; | |
$elem = $('#myModal'); | |
options = $.extend({}, Modal.DEFAULTS, $elem.data()); | |
// call father constructor | |
Modal.call(this, $elem, options); | |
} |
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
var FactorySuperImage = (function() { | |
function _onLoad() { | |
this.isloaded = true; | |
if (this.width === 0 && this.height === 0) | |
this.load_deferred.reject( new Error('image is not loaded') ); | |
else { | |
this.originalSize = { | |
width: this.width, | |
height: this.height |
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
bindOnSocketCanal: function(name, fn, scope) { | |
if (!window.now) { | |
console && console.error('sockets is not worked'); | |
return; | |
} | |
now.ready(function() { | |
if (!now[name]) { | |
// if not canal then create |
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
var data = [ | |
{ | |
id: 23, | |
name: 'Sasha', | |
age: 43 | |
}, | |
{ | |
id: 65, | |
name: 'Pasha', |
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
/** | |
* Created by mwmaleks on 29.10.13. | |
*/ | |
var Certificate = require('../models/Certificate'); | |
var path = "C:\\tmp\\testfile.txt"; | |
var fs = require('fs'); | |
function changeRonF(text) { | |
return text.replace('R', 'N'); |
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
/** | |
* Created by mwmaleks on 31.10.13. | |
*/ | |
var mongoose = require('mongoose'); | |
console.log('Версия монгуса -', mongoose.version); | |
var db = mongoose.createConnection('mongodb://localhost/learn'); | |
db.on("error", console.error.bind(console, "connection error:")); | |
db.once("open", function callback () { | |
console.log("Connected!") |
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
function _condition(a, b) { | |
return a - b; | |
} | |
Array.prototype.SelectionSort = function(condition) { | |
var len = this.length, i, min, j, | |
fn = condition || _condition; | |
// f() < n^2 | |
for ( i = 0; i < len - 1; i++ ) { |
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
function swap( obj1, obj2 ) { | |
var tmp = obj1; | |
obj1 = obj2; | |
obj2 = tmp; | |
}; | |
Array.prototype.swap = function( i, j ) { | |
swap(this[i], this[j]); | |
return this; |