Skip to content

Instantly share code, notes, and snippets.

View volodymyrsmirnov's full-sized avatar
🚀
Making things happen

Volodymyr Smirnov volodymyrsmirnov

🚀
Making things happen
View GitHub Profile
{"normalizationRules":{" ":null,"?":null,"!":null,"*":null,"/":null,"\\\\":null,"“":null,"„":null,"‘":null,",":null,":":null,";":null,"~":null,"´":null,"`":null,"^":null,"$":null,"@":"(at)","&":"(and)","%":null,"ä":"ae","ö":"oe","ü":"ue","ß":"ss","à":"a","á":"a","â":"a","è":"e","é":"e","ê":"e","ì":"i","í":"i","î":"i","ò":"o","ó":"o","ô":"o","ù":"u","ú":"u","û":"u"},"googleAnaliticsDomain":null,"googleAnaliticsCode":null,"sourcesDirectory":"A:","apptimizedEnvironment":true,"apptimizedUrl":"http://office.ops.apptimized.com:8088/Workflow/Api/Pipe?workflowId=1&projectId=4&substep=DiscoverySelfService","archiveName":"[Manufacturer]_[ProductName]_[ProductVersion]_x64_DE_R01.zip","folderName":"[Manufacturer]_[ProductName] _[ProductVersion]_x64_DE_R01","msiName":"[Manufacturer]_[ProductName]_[ProductVersion]_x64_DE_R01.msi","msiNameKeepOriginal":true,"mstName":"[Manufacturer]_[ProductName]_[ProductVersion]_x64_DE_R01.mst","cabName":"Data{0}.cab","cabEmbedded":true,"iniViaTable":true,"maxSizePerCab":2048,"msiFsPostPro
[2017-10-10 11:21:36,091] ERROR in app: Exception on /project/645.7207/discovery/screenshots/ [GET]
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 33, in reraise
raise value
python hls-analyzer.py http://144.76.3.3:1935/live/bvntv_aac/playlist.m3u8
Master playlist. List of variants:
Playlist: http://144.76.3.3:1935/live/bvntv_aac/chunklist.m3u8, bw: 2994658
***** Analyzing variant (2994658) *****
** Generic information **
Version: 3
Start Media sequence: 307
Is Live: True
# Select all users recurring user subscriptions where activation date is bigger than the lowers activation date for unexpired and enabled subscription
recurring_subscriptions = "select user_subscriptions for user where enabled=true and recurring=true and activation_date >= lowest_user_subscription_activation_date_for_user()"
# Select all users non-recurring user subscriptions where activation date is bigger than the lowers activation date for unexpired and enabled subscription (type does not matter)
non_recurring_subscriptions = "select user_subscriptions for user where recurring=false and activation_date >= lowest_user_subscription_activation_date_for_user()"
# In real world recurring_subscriptions and non_recurring_subscriptions can be joined into one DB query, I have 2 different variables here just for the ease of understanding
# Select all sessions starting from the lowers activation date for unexpired and enabled subscription, group them by day, month and year for performance
sessions = "select sess
from zway import ZWay, ZWayData
import sys
import signal
import binascii
from flask import Flask, jsonify, request, abort
app = Flask(__name__)
class ZWayHandler(ZWay):
public static XElement RemoveAllNamespaces(XElement e)
{
return new XElement(e.Name.LocalName, (
from n in e.Nodes()
select((n is XElement) ? RemoveAllNamespaces(n as XElement) : n)),
(e.HasAttributes) ? (from a in e.Attributes()
where (e.Attributes().Where(ah => a.Name != a.Name.LocalName && ah.Name == a.Name.LocalName).Count() == 0)
select new XAttribute(a.Name.LocalName, a.Value)) : null);
}
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "lighten(#000, 20%)",
"@gray": "lighten(#000, 33.5%)",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#428bca",
"@brand-success": "#5cb85c",
"@brand-info": "#5bc0de",
from flask.ext.sqlalchemy import models_committed
app = Flask(__name__)
# Parent class for models that has to be inserted into the Elastic
class ElasticModelMixin(object):
__elastic_fields__ = []
def __elastic_insert__(self):
elastic_object = {}
@volodymyrsmirnov
volodymyrsmirnov / output.js
Created May 11, 2014 19:47
Proof of concept for Python to JS translator using built-in AST parser
(function() {
var a = 1;
var b = a + 1;
a += 50;
var r = [10, 9, 8, 7];
var c =
(function() {
var _i, _len, _ref, _results;
_results = [];
_ref = [1, 5, 10] || [];
@volodymyrsmirnov
volodymyrsmirnov / sip.py
Last active January 28, 2017 04:02
SIP Wav Caller CLI
#/usr/bin/env python
import sys
from application.notification import NotificationCenter
from sipsimple.account import AccountManager
from sipsimple.application import SIPApplication
from sipsimple.core import SIPURI, ToHeader
from sipsimple.lookup import DNSLookup, DNSLookupError