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
/* | |
* Library for working with db tables. | |
* | |
* Config options: | |
* | |
* container string: идентификатор контейнера для таблицы | |
* hasInsertButton bool: показывать ли кнопку добавления записи | |
* insertButtonText string: текст кнопки добавления | |
* enableSorting bool: включить сортировку | |
* hightlightOddRows bool: подсвечивать четные строки другим цветом |
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 ($) { | |
var DOLLARS = 20; | |
$.fn.dollars = function () { | |
$(this).each(function () { | |
var $table = $(this); | |
$table.find('tr:first-child th:not(:first-child)').each(function (index) { | |
var $label = $('<span/>').appendTo($(this)), | |
$fields = $table.find('td:nth-child(' + (index + 2) + ') input'); |
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
using System; | |
using System.IO; | |
using System.Linq; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace sska | |
{ | |
class Tuple |
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
from sqlalchemy import create_engine | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy import Table, Column, Integer, ForeignKey | |
from sqlalchemy.orm import relationship, backref | |
engine = create_engine('sqlite:///:memory:', echo=True) | |
Base = declarative_base() | |
Base.metadata.bind = engine |
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
<?php | |
function formatAge($date, $point = null) { | |
$date = DateTime::createFromFormat('Y-m-d', $date); | |
$point = $point ? DateTime::createFromFormat('Y-m-d', $point) : new DateTime(); | |
$interval = $date->diff($point); | |
if ($interval->format('%r%a') <= 0) { | |
return false; | |
} |
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
<?php | |
function formatDate($date, $point = 'now') { | |
$point = date_create($point); | |
$date = date_create_from_format('Y-m-d H:i:s', $date); | |
$interval = date_diff($point, $date); | |
$delta = $point->getTimestamp() - $date->getTimestamp(); | |
$SECOND = 1; | |
$MINUTE = 60 * $SECOND; |
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 | |
if [ $# -lt 2 ] ; then | |
echo "Usage: sudo addvhost <hostname> <branch>"; | |
exit 0; | |
fi | |
email="[email protected]" | |
domain="$1" | |
branch="$2" |
NewerOlder