Skip to content

Instantly share code, notes, and snippets.

View mosquito's full-sized avatar
✍️
just writing some code

Mosquito mosquito

✍️
just writing some code
  • Nebius
  • Netherlands
View GitHub Profile
@mosquito
mosquito / -
Created September 4, 2014 12:57
I/System.out(12853): Time taken in REST operation : 21 ms.
I/System.out(12853): Time taken in service response construction : 1 ms.
W/System.err(12853): org.json.JSONException: Value <!DOCTYPE of type java.lang.String cannot be converted to JSONObject
D/PullToRefresh(12853): setHeaderScroll: -34
W/System.err(12853): at org.json.JSON.typeMismatch(JSON.java:111)
W/System.err(12853): at org.json.JSONObject.<init>(JSONObject.java:158)
W/System.err(12853): at org.json.JSONObject.<init>(JSONObject.java:171)
W/System.err(12853): at ru.myconomy.android.data.JsonParser.parseSearchOffers(JsonParser.java:251)
W/System.err(12853): at ru.myconomy.android.data.DataProvider.doSeachOffers(DataProvider.java:404)
W/System.err(12853): at ru.myconomy.android.utils.SyncSystem.runSync(SyncSystem.java:51)
@mosquito
mosquito / -
Created September 8, 2014 12:42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
@mosquito
mosquito / -
Created October 22, 2014 11:17
app.factory('$exceptionHandler', function () { return function (e) { errorHandler(e); }; });
Array.prototype.unique = function(a){return function(){ return this.filter(a) }}(function(a,b,c){ return c.indexOf(a,b+1) < 0 });
String.prototype.capitalize = function() { var s = this.toLowerCase(); return s.charAt(0).toUpperCase() + s.slice(1); };
Q.onerror = function (e) { errorHandler(e); };
Q.stopUnhandledRejectionTracking();
function errorHandler (e) {
if (e.stack) {
@mosquito
mosquito / -
Created October 24, 2014 07:55
mysql> select * from jobs \G
*************************** 1. row ***************************
id: 3
host_id: 2
job_hash: b74f2be6de60ecaf74f063f8f6660e28
name: REPORT: ACTIVE CONTENT
user: apps
command: /home/apps/mcnmpartner.env /home/apps/mcnmpartner/manage.py report_active_content
created_at: 2014-09-17 15:16:54
updated_at: 2014-09-17 16:46:24
def ip2hex(cidr, router):
addr, mask = cidr.split("/")
mask = int(mask)
addr = [("%2s" % hex(int(i))[2:]).replace(" ", "0") for i in addr.split(".") if i != "0"]
parts = mask/8 - len(addr)
if mask%8 > 0:
parts += 1
if parts > 0:
for i in range(int(parts)):
addr.append("00")
@mosquito
mosquito / -
Created November 5, 2014 16:54
Unhandled Error
Traceback (most recent call last):
File "/usr/lib64/python2.7/threading.py", line 783, in __bootstrap
self.__bootstrap_inner()
File "/usr/lib64/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib64/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
--- <exception caught here> ---
File "/usr/lib64/python2.7/site-packages/twisted/python/threadpool.py", line 196, in _worker
@mosquito
mosquito / -
Created November 21, 2014 11:26
class SVPProto(object):
@staticmethod
def size_of_package(ctx):
print ctx
return 1
REQUEST = construct.Struct("SVPRequest",
construct.ULInt16("version"),
construct.ULInt16("serial"),
construct.Value(construct.ULInt16("size"), size_of_package),
@mosquito
mosquito / -
Created December 26, 2014 13:48
redmine@redmine:~/redmine$ RAILS_ENV=production bundle exec rake db:migrate:status
database: redmine
Status Migration ID Migration Name
--------------------------------------------------
up 1 ********** NO FILE **********
up 10 ********** NO FILE **********
up 100 ********** NO FILE **********
up 101 ********** NO FILE **********
[2015-01-18 15:06:26,850] client.py:671 ERROR <?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:SletatRu:Contracts:Soap11Gate:v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="urn:SletatRu:DataTypes:AuthData:v1" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<tns:AuthInfo>
<tns:Login>**************************</tns:Login>
<tns:Password>**************</tns:Password>
</tns:AuthInfo>
</SOAP-ENV:Header>
<ns0:Body>
<ns1:SaveTourOrder>
@mosquito
mosquito / requirements.txt
Last active February 7, 2023 16:10
RTSP to HTTP python proxy
tornado>4
construct