Skip to content

Instantly share code, notes, and snippets.

View adityapooniya's full-sized avatar

Docworld adityapooniya

View GitHub Profile
@adityapooniya
adityapooniya / config_pdo.php
Created November 17, 2015 03:32 — forked from pipiscrew/config_pdo.php
PDO Custom Class
<?php
function connect_mysql() {
$mysql_hostname = "localhost";
$mysql_user = "x";
$mysql_password = "x";
$mysql_database = "x";
$dbh = new PDO("mysql:host=$mysql_hostname;dbname=$mysql_database", $mysql_user, $mysql_password,
array(
@adityapooniya
adityapooniya / dabblet.css
Created April 14, 2015 10:40 — forked from dstorey/dabblet.css
set the size of the boxes and any decoration
.slider {
/* set initial width */
width: 520px;
/* hide the content that overflows (to allow second box to show through) */
overflow: hidden;
display: inline-block;
/* skew container so that it has angled edge, and set up transition */
transform: skewX(-20deg);
@adityapooniya
adityapooniya / dabblet.css
Last active August 29, 2015 14:19
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
body {
background: #f06;
background: linear-gradient(31deg, #58f, #59f, #08d);
min-height: 100%;
height:10px;
font-size:100%;
}
@adityapooniya
adityapooniya / media_query_responsive_image.html
Created August 1, 2014 19:41
Resonsive Web Design and Development
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no,initial-scale=1.0,maximum-scale=1.0,width=device-width,minimal-ui">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title> Media-Query Responsive Image Demo </title>
<meta name="keywords" content="">
<?php
class Struct
{
/**
* Define a new struct object, a blueprint object with only empty properties.
*/
public static function factory()
{
$struct = new self;
foreach (func_get_args() as $value) {
<!-- Assume a file is uploaded with this HTML form -->
<form method="POST" enctype="multipart/form-data">
<input type="file" name="foo" value=""/>
<input type="submit" value="Upload File"/>
</form>
<!-- When the HTML form is submitted, the server-side PHP code can validate and upload the file like this: -->
/**
* setup JQuery's AJAX methods to setup CSRF token in the request before sending it off.
* http://stackoverflow.com/questions/5100539/django-csrf-check-failing-with-an-ajax-post-request
*/
function getCookie(name)
{
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
@adityapooniya
adityapooniya / gist:5520725
Created May 5, 2013 12:36
Move ball javascript code
var f = document.getElementById('foo');
document.addEventListener('click', function(ev){
f.style.left = (ev.clientX-25)+'px';
f.style.top = (ev.client-25)+'px';
},false);
@adityapooniya
adityapooniya / gist:5520714
Created May 5, 2013 12:31
move ball html
<p>Click anywhere to move the ball</p>
<div id="foo"></div>