Skip to content

Instantly share code, notes, and snippets.

View aaronshaf's full-sized avatar

Aaron Shafovaloff aaronshaf

View GitHub Profile
test
<form action="{{if _id}}/users/edit/${_id}.json{{else}}/users/add.json{{/if}}" method="post">
<div class="input">
<label>Name</label>
<input type="text" name="name" value="${name}" required="required" autofocus="autofocus" />
</div>
<div class="input">
<label>Email</label>
<input type="email" name="email" value="${email}" required />
</div>
<div class="input">
@aaronshaf
aaronshaf / es.sh
Created September 3, 2011 03:53
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
#sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@aaronshaf
aaronshaf / c9.sh
Created September 3, 2011 04:03
Install Cloud9
cd ~
sudo apt-get install libxml2-dev
git clone git://github.com/ajaxorg/cloud9.git
cd cloud9
git submodule update --init --recursive
@aaronshaf
aaronshaf / basics.sh
Created September 3, 2011 04:45
Install Basics, Apache, MongoDB, UFW, node.js, and Lithium
cd ~
echo "Server name: "
read server_name
#Basic installs
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install htop apache2 php5 php-pear php5-dev ufw subversion screen git-core php-pear build-essential openssl libssl-dev php5-dev libcurl4-openssl-dev libxml2-dev php5-curl unzip python-software-properties -y
Setting srcdir to : /var/www/shaf/node_modules/node-deflate
Setting blddir to : /var/www/shaf/node_modules/node-deflate/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for library z : no such environment: default
Media::applyFilter('_handle',function($self, $params, $chain) {
if(!empty($params['data'])) {
foreach($params['data'] as &$data) {
if(!is_object($data))
continue;
$data = $data->to('array');
}
}
return $chain->next($self, $params, $chain);
});
@aaronshaf
aaronshaf / bookmarklet-expanded.js
Last active May 13, 2024 14:35
Copy text from Amazon's Cloud Reader. Helpful for students that need block quotes.
javascript: (function () {
new_window = window.open();
new_window.document.body.innerHTML = $("iframe")
.contents()
.find("iframe")
.contents()
.find("body")
.get(1).innerHTML;
new_window.document.body.querySelector("#content-overlays").remove();
})();
default.twig:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>{{ this.title }}</title>
<link href="styles/default.css" rel="stylesheet" media="screen, projection" type$
</head>
<body>
<h1>{{ this.title }}</h1>
@aaronshaf
aaronshaf / es.sh
Created April 16, 2012 19:19
Install ElasticSearch on Ubuntu 12.04
cd ~
sudo apt-get update
sudo apt-get install unzip curl python-software-properties openjdk-7-jre -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.2.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
sudo mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share