Skip to content

Instantly share code, notes, and snippets.

<?php
$contentDir = __DIR__ . '/../web/wp-content/' ;
$yuiCompressor = 'java -jar yuicompressor-2.4.7.jar ';
$files = array();
$files[] = $contentDir . "/themes/power/js/libs/jquery.easing.1.3.js";
$files[] = $contentDir . "/themes/power/js/vehicle-finder.js";
$files[] = $contentDir . "/themes/power/js/script.js";
$files[] = $contentDir . "/themes/power/js/reviews.js";
Backbone.sync = function(method, model, options) {
// App.db is my database connection
if(_.isNull(App.db)) console.error('No Database connection!');
var query = BackboneDb.createQuery(method, model);
if (method === "read") {
var data = App.db.execute(query);
var resultJSON = BackboneDb.resultToJSON(data);
{
"folders":
[
{
"path": "/Path/To/application/dir",
"folder_exclude_patterns": ["cache", "logs"],
"file_exclude_patterns": ["*_example.*", "backup_*"],
"name": "Application Name"
},
{
<?php
/*
* This file is a demonestration for PHP Coding Standareds of WNeeds Ltd.
*
* (c) WNeeds Ltd. <anis@wneeds.com>
*/
namespace Wneeds;

Open tarminal and Run the following commands -

sudo apt-get install openjdk-7-jdk
sudo apt-get install solr-tomcat
sudo service tomcat6 start

Done! if nothing exceptional happened, Solr is installed and running under tomcat server. You can check it at http://localhost:8080/solr

Paths

/**
* Cookies - [compressed] A small class to manipulate cookies from javascript
* Uncompressed version: https://gist.github.com/gists/4139367
*/
window.Cookies={set:function(e,t,n,r){if(n){var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var s="; expires="+i.toGMTString()}else var s="";var o=r||"/";document.cookie=e+"="+t+s+"; path="+o},get:function(e){var t=e+"=";var n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return i.substring(t.length,i.length)}return null},"delete":function(e){this.set(e,"",-1)}}
/**
* Cookies - A small class to manipulate cookies from javascript
*
* Compressed version: https://gist.github.com/4147384
*
* @see www.quirksmode.org/js/cookies.html
* @author Anis uddin Ahmad <anisniit@gmail.com>
*/
window.Cookies = {
(function () {
var input = document.getElementById("image"), formdata = false;
if (window.FormData) {
formdata = new FormData();
}
input.addEventListener("change", function (evt) {
<style type="text/css">
a.user-image {
background: transparent no-repeat top left;
display: block;
text-indent: -999em;
width: 50px;
height: 50px;
border-radius: 5px;
box-shadow: 0px 0px 3px #666;
}
=begin Hangman
A simple word game
Date: 5th Aug, 2011
Author: Anis uddin Ahmad <anisniit@gmail.com>
=end
#require SecureRandom