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);
<?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) {
/**
* 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(';');