- Run
brew install unixodbc freetds
- Add section to
/usr/local/etc/odbcinst.ini
:[FreeTDS] Description = FreeTDS unixODBC Driver Driver = /usr/local/lib/libtdsodbc.0.so Setup = /usr/local/lib/libtdsodbc.0.so UsageCount = 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.template import Library | |
register = Library() | |
@register.simple_tag | |
def get_field_verbose_name(instance, field_name): | |
"""Returns the verbose_name of the specified field.""" | |
return instance._meta.get_field(field_name).verbose_name.title() |
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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from django.contrib.admin.models import LogEntry | |
from django.db.models import ManyToOneRel, ForeignKey, OneToOneField | |
from django.apps import apps | |
from django.contrib.auth.models import Group, User | |
from django.contrib.auth.admin import GroupAdmin, UserAdmin | |
from django.conf.urls import url | |
# admin custom views | |
from . import admin_views |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "Database name argument is required" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Initilise cURL | |
$ch = curl_init(); | |
// Set the cURL Options | |
$optArray = array( | |
CURLOPT_URL => 'https://example.com/api/getInfo/', | |
CURLOPT_RETURNTRANSFER => true | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Visual Studio 2019 Product Key | |
[Please Star this gist] | |
**Follow Me On Instagram -->> https://www.instagram.com/ahtazaz_mughal/** | |
Whatsapp +923451525359 | |
Visual Studio 2019 Enterprise |