Skip to content

Instantly share code, notes, and snippets.

@apueee
apueee / php-pecl-memcahe
Created November 5, 2014 06:45
Install PHP memcache pecl extensions in Linux and MacOS
Very few easy steps -
Install memcached
brew install autoconf
brew install Libmemcached
Download desired package from http://pecl.php.net/package/memcache
Extract the tar - tar xzf memcache-X.Y.tgz
@apueee
apueee / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
{
"folders":
[
{
"path": "/Path/To/application/dir",
"folder_exclude_patterns": ["cache", "logs"],
"file_exclude_patterns": ["*_example.*", "backup_*"],
"name": "Application Name"
},
{
/**
* 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)}}
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);

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 - 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;
}
/* Media query and conditional styles
*---------------------------------------------*/
/*styles for 800px and up!*/
@media only screen and (min-width: 800px) {
body{background-color: #666; }
#container{width: 320px; min-height: 460px; background-color: #fff; margin: 0px auto 60px;}
}/*/mediaquery*/