Skip to content

Instantly share code, notes, and snippets.

View vitallium's full-sized avatar
🖥️
Hex, Bugs and Source Control!

Vitaly Slobodin vitallium

🖥️
Hex, Bugs and Source Control!
View GitHub Profile
@vitallium
vitallium / 0001-Fix-missing-ICO-plugin.patch
Created September 13, 2012 09:39
Fix missing ICO plugin
From 2d7806b6a5e89e4daebbd78c7fd553d994ef6090 Mon Sep 17 00:00:00 2001
From: Vitaliy Slobodin <vitaliy.slobodin@gmail.com>
Date: Thu, 13 Sep 2012 13:36:20 +0400
Subject: [PATCH] Fix missing ICO plugin
---
src/main.cpp | 1 +
src/phantomjs.pro | 3 +-
src/qt/src/plugins/imageformats/ico/ico.pro | 14 +
src/qt/src/plugins/imageformats/ico/main.cpp | 96 +++
@vitallium
vitallium / fix_compile_vs2012
Created December 4, 2012 06:46
[PhantomJS] Patch for compiling using VS2012
diff --git a/src/qt/mkspecs/win32-msvc2010/qmake.conf b/src/qt/mkspecs/win32-msvc2010/qmake.conf
index 036c522..ea2ddb0 100644
--- a/src/qt/mkspecs/win32-msvc2010/qmake.conf
+++ b/src/qt/mkspecs/win32-msvc2010/qmake.conf
@@ -9,7 +9,7 @@ TEMPLATE = app
CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe
QT += core gui
DEFINES += UNICODE WIN32 QT_LARGEFILE_SUPPORT
-QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
+QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32

Building static libcurl and openssl on Windows

These instructions were tested on Windows 7 Professional w/ Visual Studio 2010

Building openssl

  1. Download the latest openssl from the website; at the time of this writing, it is 1.0.0d
  2. Extract it to your drive; I put it in c:\code\openssl-1.0.0d
  3. install ActiveState perl unless you already have a non-cygwin perl installed on windows
@vitallium
vitallium / use_auto_connection_for_frameCreated_signal.patch
Last active December 11, 2015 19:38
use_auto_connection_for_frameCreated_signal
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 3b21563..82aacf2 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -337,7 +337,7 @@ WebPage::WebPage(QObject *parent, const QUrl &baseUrl)
// @see WebPage::setupFrame(QWebFrame *) for details.
connect(m_mainFrame, SIGNAL(loadStarted()), this, SLOT(switchToMainFrame()), Qt::QueuedConnection);
connect(m_mainFrame, SIGNAL(loadFinished(bool)), this, SLOT(setupFrame()), Qt::QueuedConnection);
- connect(m_customWebPage, SIGNAL(frameCreated(QWebFrame*)), this, SLOT(setupFrame(QWebFrame*)), Qt::QueuedConnection);
+ connect(m_customWebPage, SIGNAL(frameCreated(QWebFrame*)), this, SLOT(setupFrame(QWebFrame*)), Qt::DirectConnection);
@vitallium
vitallium / minimal.js
Created March 4, 2013 15:30
A minimal example for PhantomJS
var page = require('webpage').create();
page.open('http://google.com', function () {
page.render('google.png');
phantom.exit();
});
@vitallium
vitallium / vs2012_fix.patch
Created March 22, 2013 11:04
VS2012 fix
diff --git a/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h b/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
index 82245f3..932d254 100644
--- a/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
+++ b/src/qt/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h
@@ -175,18 +175,20 @@ namespace WTF {
}
template<typename T, typename U, typename V>
- inline pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
+ inline pair<typename HashSet<T,U,V>::const_iterator, bool> HashSet<T,U,V>::add(const ValueType &value)
var page = require('webpage').create();
var server = require('webserver').create();
server.listen(12345, function(request, response) {
if (request.headers['Authorization']) {
var encAuth = request.headers['Authorization'].substring(6);
var credentials = atob(encAuth);
response.statusCode = 200
response.write('Provided credentials:' + credentials);
console.log(credentials);
@vitallium
vitallium / fix_js_interrupt.patch
Last active December 15, 2015 17:09
Fix JS interrupt
From 96832b2ef7376b20598c3ae372b490f52c80f28d Mon Sep 17 00:00:00 2001
From: Vitaliy Slobodin <vitaliy.slobodin@gmail.com>
Date: Wed, 3 Apr 2013 22:06:38 +0400
Subject: [PATCH] Define the new page callback for interrupting a long-running
JavaScript
---
src/modules/webpage.js | 3 +++
src/webpage.cpp | 37 +++++++++++++++++++++++++++++++++++--
src/webpage.h | 2 ++
import sys
import os
from xml.etree import ElementTree
def updateProject(filename):
def getXmlns(tag):
return tag[1:].split('}')[0]
tree = ElementTree.parse(filename)
exports.run = function run() {
console.log('Hi from A!');
};