Skip to content

Instantly share code, notes, and snippets.

@codesynapse
codesynapse / php-mysql-database.php
Created April 1, 2013 07:26
PHP MySQL Database Code Snippets
// PHP Mysql Database Query for fetching table result
<?php
/*Connects to your Database */
mysql_connect("localhost", "root", "xxxx") or die(mysql_error());
mysql_select_db("classifieds") or die(mysql_error());
$data = mysql_query("SELECT * FROM property")
or die(mysql_error());
@codesynapse
codesynapse / Wordpress-shortcodes
Created April 1, 2013 07:21
WordPress ShortCodes
//Remove the Website Comment URL Field
add_filter('comment_form_default_fields', 'url_filtered');
function url_filtered($fields)
{
if(isset($fields['url']))
unset($fields['url']);
return $fields;
}
@codesynapse
codesynapse / jquery-single-page
Created March 2, 2013 09:12
Jquery Mobile Single Page Template with Lists Code Snippet
<html>
<head>
<link rel="stylesheet" href="themes/mango.min.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile.structure-1.3.0.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
@codesynapse
codesynapse / Open Graph Snippet
Created March 1, 2013 20:20
Open Graph Snippet for Blog (Solution for Non WordPress Blogs and Sites)
<!-- BEGIN Open Graph tags -->
<!-- title & tpye -->
<b:if cond='data:blog.pageType == "index"'>
<meta content='blog' property='og:type'/>
<meta expr:content='data:blog.pageTitle' property='og:title'/>
<b:else/>
<meta content='article' property='og:type'/>
@codesynapse
codesynapse / unity-2d-icon-size
Last active December 14, 2015 03:49
Unity Launcher Icon Resize Python Script Script was made for the Unity 2D Icon resize feature because myunity was not possible. This script makes this easy to resize the icon. Usage: sudo ./script.py xx e.g. sudo ./script.py 32
#!/usr/bin/python
import shutil
import sys
import os
def getparent (content, line_nr):
for i in range (line_nr - 1, -1, -1):
if "{" in content[i].lstrip():
return content[i].lstrip().split(" ")[0]
@codesynapse
codesynapse / index.php
Created February 14, 2013 11:10
Squid Theme - index.php
<html>
<head>
<title>Squid</title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php wp_title(); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
@codesynapse
codesynapse / style.css
Created February 14, 2013 11:08
Squid Theme Style.CSS
/*
Theme Name: Squid
Theme URI: http://wordpress.org/
Description: Squid Demo theme for WordPress.
Author: Mahesh
Author URI: http://wordpress.org/
Version: 1.0
Tags: white, two-columns
License: