Skip to content

Instantly share code, notes, and snippets.

View arbaaz's full-sized avatar
🔥
Building an amazing product

Arbaaz arbaaz

🔥
Building an amazing product
View GitHub Profile
@arbaaz
arbaaz / xmltodb.cs
Created July 9, 2014 06:44
Applying xslt on xml and storing in database
using System.Data;
using System.IO;
using System.Xml;
using System.Xml.Xsl;
namespace xmltodb
{
internal static class Program
{
@arbaaz
arbaaz / csvtoTable
Last active August 29, 2015 14:03
CSV to Table Function
/****** Object: UserDefinedFunction [dbo].[CSVToTable] Script Date: 06/29/2014 12:40:43 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[CSVToTable] (@InStr VARCHAR(MAX))
RETURNS @TempTab TABLE
(ContainerNumber varchar(max) not null)
AS
@arbaaz
arbaaz / email_lite.html
Created March 20, 2014 08:42
Email Broiler plate
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Your Message Subject or Title</title>
<style type="text/css">
/* Based on The MailChimp Reset INLINE: Yes. */
/* Client-specific Styles */
#outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
@arbaaz
arbaaz / ie.html
Created March 14, 2014 13:08
IE_conditional_tag
<!--[if (gte mso 9)|(IE)]>
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<![endif]-->
This is conditional tag for IE rendering engine
<!--[if (gte mso 9)|(IE)]>
</td>
</tr>
</table>
@arbaaz
arbaaz / js_var.php
Created February 12, 2014 18:23
passing variable to javascript
passing a php variable to the javascript
<?php
$phpdata=array('key1'=>'some value','key2'=>'another value');
$jsondata=json_encode($phpdata);
echo "var mydata=".$jsondata.";";
?>
This will give you javascript that looks like this:
@arbaaz
arbaaz / mail.php
Created February 11, 2014 07:37
email using CI
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Mail extends CI_Controller {
function __construct()
{
parent::__construct();
//Do your magic here
$this->load->model('membership_model');
$config = Array(
@arbaaz
arbaaz / index.php
Created February 5, 2014 11:33
echo indian time in php
<?php if (function_exists('date_default_timezone_set'))
{
date_default_timezone_set('Asia/Kolkata');
} echo date("h:i:s"); ?>
@arbaaz
arbaaz / url_params.js
Created February 4, 2014 06:51
get_url_params_jquery.js
function getUrlParams() {
var paramMap = {};
if (location.search.length == 0) {
return paramMap;
}
var parts = location.search.substring(1).split("&");
for (var i = 0; i < parts.length; i ++) {
var component = parts[i].split("=");
@arbaaz
arbaaz / tally.xml
Created January 28, 2014 09:42
TALLY9.0 ERP
<ENVELOPE>
<HEADER>
<VERSION></VERSION>
<TALLYREQUEST></TALLYREQUEST>
<TYPE></TYPE>
<SUBTYPE></SUBTYPE>
<ID></ID>
</HEADER>
<BODY>
@arbaaz
arbaaz / mail.php
Created January 27, 2014 10:19
Send email from codeigniter
public function index()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp3.netcore.co.in',
'smtp_port' => 25,
'smtp_user' => '[email protected]',
'smtp_pass' => 'Supp0rt',
'mailtype' => 'html',
'charset' => 'utf-8',