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 { | |
background: url(images/bg.jpg) no-repeat center center fixed; | |
-webkit-background-size: cover; | |
-moz-background-size: cover; | |
-o-background-size: cover; | |
background-size: cover; | |
} |
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
more S170111A.txt | awk -F";" '{ print strftime("%Y-%d-%m %H:%M:%S",mktime(substr($1,2,4) " " substr($1,6,2) " " substr($1,8,2) " " substr($1,10,2) " " substr($1,12,2) " " substr($1,14,2))) "," $3 "," $7 "," $8 "," $20}' | |
mongoimport -d fsb -c cdr --type csv --headerline --columnsHaveTypes --file imp.p1 |
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
require 'grape' | |
class HelloWorld < Grape::API | |
format :json | |
helpers do | |
def logger | |
HelloWorld.logger | |
end | |
end |
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
console.log('\'Allo \'Allo!'); | |
$(document).ready(function() { | |
$('#example').DataTable( { | |
"processing": true, | |
"serverSide": true, | |
"ajax": "http://localhost:9292/hello/cdr", | |
"columns": [ | |
{"data": "date"}, | |
{"data": "caller"}, |
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
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 |
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
# | |
# Network services, Internet style | |
# | |
# Note that it is presently the policy of IANA to assign a single well-known | |
# port number for both TCP and UDP; hence, most entries here have two entries | |
# even if the protocol doesn't support UDP operations. | |
# | |
# The latest IANA port assignments can be gotten from | |
# | |
# http://www.iana.org/assignments/port-numbers |
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
# | |
# Network services, Internet style | |
# | |
# Note that it is presently the policy of IANA to assign a single well-known | |
# port number for both TCP and UDP; hence, most entries here have two entries | |
# even if the protocol doesn't support UDP operations. | |
# | |
# The latest IANA port assignments can be gotten from | |
# | |
# http://www.iana.org/assignments/port-numbers |
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
# В целом создание корзины магазина неплохо описано в Agile web development | |
# with Rails. Думаю что концепция CRUID для данного типа приложений выглядит | |
# более естественно. Так же хорошо вписывается в данную модель создание промежуточной | |
# сущности между item между корзиой и списком товаров. | |
# В цело данный метод слишком веоик, не интуитивен и смешивает в кучу все слои MVC. | |
class BasketController | |
def add_to_basket | |
# Предпочтительно оперировать понятием уникального идентификатора id | |
item = Item.find_by_title(params[:item_title]) |
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
-- intervals in days | |
SET @history_interval = 7; | |
SET @trends_interval = 90; | |
DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); | |
DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60); |
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
#!/bin/bash | |
#============================================================================== | |
#TITLE: mysql_backup.sh | |
#DESCRIPTION: script for automating the daily mysql backups on development computer | |
#AUTHOR: tleish | |
#DATE: 2013-12-20 | |
#VERSION: 0.4 | |
#USAGE: ./mysql_backup.sh | |
#CRON: | |
# example cron for daily db backup @ 9:15 am |