Skip to content

Instantly share code, notes, and snippets.

View dharma017's full-sized avatar

Dharma R. Thapa dharma017

  • Melbourne, Australia
View GitHub Profile
@dharma017
dharma017 / sample-html-page.html
Last active January 6, 2016 06:54
HTML: Test Page
<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
<hr />
<h1 id="headings">Headings</h1>
<h1>Heading 1</h1>
@dharma017
dharma017 / codeigniter-my-model.php
Last active January 6, 2016 06:54
Codeigniter MY_Model
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* CodeIgniter MY_Model class
*
* Basic data access functionality for CodeIgniter projects
*
* @package CodeIgniter
* @subpackage Core
* @category Core
@dharma017
dharma017 / st2-shortucts.textile
Last active January 6, 2016 06:53 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dharma017
dharma017 / awesome-php.md
Created November 1, 2012 01:22 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
@dharma017
dharma017 / test-mail.php
Last active November 27, 2015 06:14
PHP: Test Mail
<?php
$to = 'to@mail.com';
$subject = 'the subject';
$message = 'hello\r\n';
$message .= 'world\r\n';
$headers = 'From: from@mail.com' . "\r\n" .
'Reply-To: replyto@mail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
#!/bin/bash
###
#
# forked from https://gist.github.com/1264701/08f93534ba177f173b9382b53c419cd0de5b07ea
# Copyright (c) 2011 Cake Development Corporation (http//cakedc.com)
#
# Ubuntu 12.10 based web server installation script
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
####################################################################################
## ##
## gittyup() - Easily keep master in sync with upstream. ##
## ##
## Author: Evan Coury, http://blog.evan.pro/ ##
## URL: https://gist.github.com/1506822 ##
## ##
## This bash function is a simple shortcut for keeping your local (and public ##
## fork / origin remote) master branch up to date and in sync with the upstream ##
## master. To use gittyup(), simply drop this in your ~/.bashrc. ##
@dharma017
dharma017 / ci-database-debug.md
Last active December 15, 2015 06:58
Codeigniter database connection check

Add following code to debug database connection in codeigniter

echo '<pre>';
 print_r($db['default']);
echo '</pre>';

echo 'Trying to connect to database: ' .$db['default']['database'];
$dbh=mysql_connect
(
<!-- Paste this code into an external JavaScript file named: timePage.js -->
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Cody Shaffer :: http://codytheking313.byethost11.com */
var time=1;
function timeHere() {
time = time + 1;
@dharma017
dharma017 / flip-https-to-http
Created August 22, 2013 03:32
how-to-use-htaccess-to-flip-from-https-to-http
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^(/checkout)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]