Skip to content

Instantly share code, notes, and snippets.

View llCorvinSll's full-sized avatar

Dmitry Pronin llCorvinSll

View GitHub Profile
@llCorvinSll
llCorvinSll / build.txt
Created November 3, 2013 09:57
Qt subdirs project and setup deps between subprojects
include( ../common.pri )
TEMPLATE = app
SOURCES += main.cpp
LIBS += -L../logic -llogic \
-L../gui -lgui
# Will build the final executable in the main project directory.
@llCorvinSll
llCorvinSll / Lazy Instance
Created October 31, 2013 06:19
Create Lazy instance of object which requires setup after creating
class Client
{
public static TClient CreateInst<TClient, TInterface>(string url, string domain, string username, string password)
where TClient : System.ServiceModel.ClientBase<TInterface>
where TInterface : class
{
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
@llCorvinSll
llCorvinSll / arrow.css
Created October 4, 2013 19:45
Make arrow from element
.arrow {
height: 15px;
width: 0px;
border-top: 15px solid rgba(0,0,0,0.75);
border-right: 15px solid transparent;
border-left: 15px solid transparent;
bottom: -15px;
content: '';
display: block;
}
@llCorvinSll
llCorvinSll / get_data_from_form
Last active December 22, 2015 07:58
Get data from form on submit
$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');