Skip to content

Instantly share code, notes, and snippets.

View nitindhar7's full-sized avatar

Nitin Dhar nitindhar7

View GitHub Profile
development:
adapter: sqlserver
database: mydatabase
username: myusername
password: mypassword
dsn: mydsn
/etc/freetds/freetds.conf
[mydsn]
host = server_ip_address
port = 1433
tds version = 7.0
/etc/odbcinst.ini
[FreeTDS]
Description = TDS driver (Sybase/MS SQL)
Driver = /usr/lib/odbc/libtdsodbc.so
Setup = /usr/lib/odbc/libtdsS.so
CPTimeout =
CPReuse =
FileUsage = 1
/etc/odbc.ini
export ODBCINI=/etc/odbc.ini
export ODBCSYSINI=/etc
export FREETDSCONF=/etc/freetds/freetds.conf
sqsh -S mydsn -U db_username -P db_password
# AND/OR
isql -v myserver_dsn username password
USE company;
SELECT * FROM departments;
<div id="progressbar" class="ui-progressbar">
// Initialize
$('#progressbar').progressbar({ value: 0 });
// Record current position in a list
current_position = 0;
// Record list length
list_length = $('li').length;
// Loop through the list
+----------+---------+-------------+
| Database | Records | Time Taken |
+----------+---------+-------------+
| MySQL | 10000 | 206 seconds |
| mongoDB | 10000 | 196 seconds |
+----------+---------+-------------+
+----------+---------+-------------+
| Database | Records | Time Taken |
+----------+---------+-------------+
| MySQL | 5000000 | 8.5 hours |
// elapsed time in days (BAD)
int d;
// (GOOD)
int elapsedTimeInDays;