Skip to content

Instantly share code, notes, and snippets.

View drfill's full-sized avatar

Fill Quazy drfill

  • NJoyX
  • Riga, Latvia
View GitHub Profile
@drfill
drfill / q.py
Created October 26, 2016 20:23 — forked from gfranxman/q.py
twisted q
from twisted.internet import reactor, protocol
from twisted.protocols import policies
from twisted.protocols import basic
import queue
WAITING = 'waiting'
COLLECTING = 'collecting'
IDLE = 'idle'
@drfill
drfill / sample-eventd-script-for-twisted
Created September 28, 2016 13:39 — forked from dustin/sample-eventd-script-for-twisted
Sample upstart script for a twisted project.
# 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
@drfill
drfill / urlnorm.py
Last active August 29, 2015 14:26 — forked from mnot/urlnorm.py
urlnorm.py: URL normalisation
#!/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 '.'
@drfill
drfill / nginx.conf
Last active August 29, 2015 14:21 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@drfill
drfill / gitlab
Created January 30, 2014 08:36 — forked from xoro/gitlab
#!/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
#!/bin/sh
# PROVIDE: teamcity
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for teamcity in /etc/rc.conf:
#
# teamcity_enable (bool):
#!/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:
(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.
*
.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;
}
@drfill
drfill / clock.js
Last active December 23, 2015 19:29
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