Skip to content

Instantly share code, notes, and snippets.

View itswadesh's full-sized avatar

Swadesh Behera itswadesh

View GitHub Profile
@itswadesh
itswadesh / gist:5040964
Created February 26, 2013 18:46
HTML: General Template
<html>
</html>
@itswadesh
itswadesh / gist:5045447
Created February 27, 2013 05:45
HTML: Basic Code Block - codenx
(head>title{Speedup web development - codenx}+link[rel="stylesheet" href="css/style.css"])+body((.header>(.header-wrapper>h1{CodeNx}+.search+.user))+(.nav>.nav-wrapper>ul>li>a{item}*4))+(.content>.content-wrapper>.sidebar+.main-container>h1+p)+.footer>.footer-wrapper>p{Developed by <a href='http://codenx.com'> CodeNx</a>}+script[src=js/jquery.js]
@itswadesh
itswadesh / gist:5046276
Created February 27, 2013 08:27
HTML: Advanced Full Page HTML Snippet
(head>title{Speedup Web Development - codenx}+link[rel="stylesheet" href="css/style.css"])+body((.header.clearfix>(.header-wrapper>(.logo.fl>(a[href='/']{CodeNx}))+(.search.fl>form[method='GET' action='./index.php?qa=search']>input[name='sw' value='search' type='hidden']+input[name='q' value='' type='text'])+.user.fr>ul>li*3>a[href='/']{Login}))+(.nav>.nav-wrapper>ul>li*4>a{item}))+(.content>.content-wrapper>(.sidebar>.sidebar-list>ul>li*3>a[href='/'])+.main-container>h1+p)+.footer>.footer-wrapper>p{Developed by <a href='http://codenx.com'> CodeNx</a>}+script[src=js/jquery.js]
@itswadesh
itswadesh / style.css
Created February 27, 2013 10:08
css: General css for any website
/*
Theme Name: ReClean
Theme URI: http://www.codenx.com/
Theme Version: 1.0
Theme Date: 2013-03-12
Theme Author: CodeNx
Theme Author URI: http://www.codenx.com/
Theme License: GPLv2
*/
<?php
class Database {
private $host = "localhost";
private $user = "root";
private $password = "root";
private $database = "crud";
function runQuery($sql) {
$conn = new mysqli($this->host,$this->user,$this->password,$this->database);
if ($conn->connect_error) {
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Send email using NodeJS</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.5/css/materialize.min.css" type="text/css" rel="stylesheet" media="screen,projection"/>
--
-- Table structure for table `books`
--
CREATE TABLE IF NOT EXISTS `books` (
`name` varchar(255) DEFAULT NULL,
`author` varchar(255) DEFAULT NULL
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
--
'use strict';
angular.module('sendmailApp', [])
.controller('MailController', function ($scope,$http) {
$scope.loading = false;
$scope.mail = {to: 'support@codenx.com'};
$scope.send = function (mail){
$scope.loading = true;
$http.post('api/index.php', { to: mail.to }).then(res=>{
$scope.loading = false;
<?php
include('config.php');
include('database.php');
$email = TO;
if(isset($_POST['email'])) $email = $_POST['email'];
$database = new Database();
$result = $database->runQuery("SELECT name,author FROM books");
$header = $database->runQuery("SELECT UCASE(`COLUMN_NAME`)
FROM `INFORMATION_SCHEMA`.`COLUMNS`
WHERE `TABLE_SCHEMA`='demos'
<?php
define('DATABASE_HOST', "localhost");
define('DATABASE_NAME', "demos");
define('DATABASE_USERNAME', "root");
define('DATABASE_PASSWORD', "root");
define('ATTACHED_FILENAME', "books.pdf");
define('SENDGRID_USERNAME', "YOUR_SENDGRID_USERNAME");
define('SENDGRID_PASSWORD', "YOUR_SENDGRID_PASSWORD");
define('FROM', "demo@angularcode.com");
define('TO', "support@codenx.com");