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 twisted.internet import reactor, protocol | |
| from twisted.protocols import policies | |
| from twisted.protocols import basic | |
| import queue | |
| WAITING = 'waiting' | |
| COLLECTING = 'collecting' | |
| IDLE = 'idle' |
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
| # This is a sample script for upstart to keep a twisted project running. | |
| # Place it in /etc/event.d/[projectname] | |
| description "useful description" | |
| author "Dustin Sallings <dustin@spy.net>" | |
| start on runlevel 2 | |
| start on runlevel 3 | |
| stop on runlevel 0 |
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
| #!/usr/bin/env python | |
| """ | |
| urlnorm.py - URL normalisation routines | |
| urlnorm normalises a URL by; | |
| * lowercasing the scheme and hostname | |
| * taking out default port if present (e.g., http://www.foo.com:80/) | |
| * collapsing the path (./, ../, etc) | |
| * removing the last character in the hostname if it is '.' |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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/sh | |
| # | |
| # Written by Denis Vazhenin <denis.vazhenin@me.com> | |
| # | |
| # This script was ported from Debian/Ubuntu version of start script for Gitlab: | |
| # https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/init.d/gitlab | |
| # | |
| # PROVIDE: gitlab | |
| # REQUIRE: NETWORKING SERVERS DAEMON LOGIN | |
| # KEYWORD: shutdown |
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/sh | |
| # PROVIDE: teamcity | |
| # REQUIRE: LOGIN | |
| # KEYWORD: shutdown | |
| # | |
| # Configuration settings for teamcity in /etc/rc.conf: | |
| # | |
| # teamcity_enable (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
| #!/bin/sh | |
| # $FreeBSD: head/devel/youtrack/files/youtrack.in 329474 2013-10-05 16:11:37Z lwhsu $ | |
| # | |
| # PROVIDE: youtrack | |
| # REQUIRE: LOGIN | |
| # KEYWORD: shutdown | |
| # | |
| # Configuration settings for youtrack in /etc/rc.conf: |
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($) { | |
| /** | |
| * Daily Counter Clock Face | |
| * | |
| * This class will generate a daily counter for FlipClock.js. A | |
| * daily counter will track days, hours, minutes, and seconds. If | |
| * the number of available digits is exceeded in the count, a new | |
| * digit will be created. | |
| * |
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
| .your-clock { width: 350px !important; } | |
| /* Reset */ | |
| .flip-clock-wrapper * { | |
| margin: 0; | |
| padding: 0; | |
| -webkit-box-sizing: border-box; | |
| -moz-box-sizing: border-box; | |
| -o-box-sizing: border-box; | |
| box-sizing: border-box; | |
| } |
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 date = "24.09.2013 15:50:00" // формат - день.месяц.год час:минута:секунда | |
| var a = new Date(); | |
| var regex = /(\d{1,2})\.(\d{1,2})\.(\d{4}) (\d{1,2}):(\d{1,2}):(\d{2})/; | |
| var date2 = regex.exec(date) | |
| var b = new Date(date2[3], parseInt(date2[2])-1, date2[1], date2[4], date2[5], date2[6]); | |
| var clksec = parseInt((b - a) / 1000); | |
| var clock = $('.your-clock').FlipClock(clksec, { | |
| clockFace: 'DailyCounter', | |
| countdown: true |