Skip to content

Instantly share code, notes, and snippets.

View ademkocamaz's full-sized avatar

Adem KOCAMAZ ademkocamaz

View GitHub Profile
@rduplain
rduplain / README.md
Created October 17, 2011 20:04
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

@rdingwall
rdingwall / DynamicJsonDeserializer.cs
Created February 22, 2012 12:22
RestSharp deserialize JSON to dynamic
// ReSharper disable CheckNamespace
namespace RestSharp.Deserializers
// ReSharper restore CheckNamespace
{
public class DynamicJsonDeserializer : IDeserializer
{
public string RootElement { get; set; }
public string Namespace { get; set; }
public string DateFormat { get; set; }
@Stephanvs
Stephanvs / DynamicJsonDeserializer.cs
Created February 22, 2012 18:54 — forked from rdingwall/DynamicJsonDeserializer.cs
RestSharp deserialize JSON to dynamic
// ReSharper disable CheckNamespace
namespace RestSharp.Deserializers
// ReSharper restore CheckNamespace
{
public class DynamicJsonDeserializer : IDeserializer
{
public string RootElement { get; set; }
public string Namespace { get; set; }
public string DateFormat { get; set; }
@taterbase
taterbase / upload.php
Created May 13, 2012 15:03
Simple file upload in php
<!DOCTYPE html>
<html>
<head>
<title>Upload your files</title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<p>Upload your file</p>
<input type="file" name="uploaded_file"></input><br />
<input type="submit" value="Upload"></input>
@codeofmichaela
codeofmichaela / hl7mlp_receiver.js
Created September 3, 2014 21:55
A simple node.js HL7 MLP server. Saves messages in files in a local folder, and generates ACK to send back to application.
/*
Author: Michael Stevenson
Date : 2014/09/03
Desc : Receive HL7 message from an MLP tcp interface on a specific port and ip.
Saves message to folder on PC. Constructs and sends ACK back to interface
*/
var net = require('net');
var fs = require('fs');
@shymonk
shymonk / customize-save-in-django-admin-inline-form.org
Last active April 14, 2024 02:55
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):
@deepak-rajpal
deepak-rajpal / simplexml-curl-feed-fetch.php
Created September 3, 2015 13:48
Fetch XML Feeds using cURL and SimpleXML - Best and Tested
<?php
/* Fetch XML feeds using PHP SimpleXML and cURL */
/* Step 1) Parse xml url in curl and assign all data into a variable
Step 2) Pass Xml data into SimpleXML and access elements using returned object */
/* =================The SimpleXML =========================
The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators.
This extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required, although this is implicitly accomplished because libxml is enabled by default. The SimpleXML extension requires PHP 5.
@mcxiaoke
mcxiaoke / nginx-gitweb.md
Created January 18, 2016 02:54
Set up Gitweb + Nginx from scratch on Debian Wheezy

This guide offers the least time-consuming way of setting up Nginx for serving Git repositories over HTTP using Gitweb. The stuff here has been tested with Git 1.9.1 and Nginx 1.6.0 on Debian Wheezy. Probably also works for Ubuntu, etc.

Total time ~ 10 minutes.

Install

Enable wheezy-backports by adding this line to /etc/apt/sources.list:

deb http://http.debian.net/debian wheezy-backports main
@mayrund
mayrund / Network Initialization Failed C:\PDOXUSERS.NET Permission Denied
Created November 21, 2016 10:57
Network Initialization Failed C:\PDOXUSERS.NET Permission Denied
EDBEngineError-Network Initialization Failed
Permission Denied
File C:\PDOXUSERS.NET
Directory: c:\
1. Create a new directory such as C:\BDEShare or use an existing folder (like My Documents).
2. Start the BDE Administration utility, located in: C:\Program Files (x86)\Common Files\Borland Shared\BDE\BDEADMIN.EXE
3. Click Configuration -> Drivers -> Native -> Paradox
4. Cick on the path next to NET DIR
5. Click the browse button to the right of the path
@blubberdiblub
blubberdiblub / sub_qt.py
Created January 20, 2017 07:40
Minimal console output of a subprocess with PyQt.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from PyQt5.QtCore import pyqtSignal, pyqtSlot, QProcess, QTextCodec
from PyQt5.QtGui import QTextCursor
from PyQt5.QtWidgets import QApplication, QPlainTextEdit