Skip to content

Instantly share code, notes, and snippets.

View aghecht's full-sized avatar

Alan Hecht aghecht

View GitHub Profile
@aghecht
aghecht / 0_reuse_code.js
Created April 18, 2014 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// requirejs config in main.js
require.config({
paths: {
jquery: 'components/jquery/jquery',
es5shim: 'components/es5-shim/es5-shim',
es5sham: 'components/es5-shim/es5-sham'
},
map: {
'*': {
'flight/component': 'components/flight/lib/component',
@aghecht
aghecht / init.el
Created January 3, 2014 19:15
Emacs Init file
(setq ls-lisp-use-insert-directory-program t)
(setq insert-directory-program "gls")
(add-to-list 'load-path "~/.emacs.d/personal/emacs-elixir")
(require 'elixir-mode)
(add-to-list 'load-path "~/.emacs.d/personal/jade-mode")
(require 'sws-mode)
(require 'jade-mode)
(add-to-list 'auto-mode-alist '("\\.styl$" . sws-mode))
@aghecht
aghecht / method.js
Created December 21, 2013 20:51
'method' method from JS the good parts
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
};
@aghecht
aghecht / launch_asdf.rb
Created December 18, 2013 20:16
Launch asdf
require 'asdf'
asdf = Asdf::Server.new
asdf.start
@aghecht
aghecht / gist:6638791
Created September 20, 2013 14:56
nokogiri install
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.28
@aghecht
aghecht / unicorn.rb
Created August 12, 2013 18:00
unicorn config
require "bundler/capistrano"
set :application, "xxx"
set :repository, "xxx"
set :scm, :git
set :branch, "locomotive"
# set :deploy_to "/u/apps/#{application}"

Product management has come up with the idea of allowing website users to leave reviews and ratings for listings. This feedback will be entered similar to how leads are submitted, but the user must enter the following information:

  • name
  • email address
  • phone number
  • rating from 1 to 5
  • optional review

In addition to the above information, a CAPTCHA presenting three different apartment complexes (only one of which is correct) is used in conjunction with the user’s name and phone number to determine whether or not the user actually lived at the listing. After validating and verifying the information, the user gets redirected to a thank you page. After a review is successfully submitted, it will show up as the first entry in the reviews for the listing. Pre-existing “certified resident” reviews will be integrated along with reviews that are submitted through the site. On the search results page, users can sort on rating type or filter on review type and rating. A link on each listing will take the us

@aghecht
aghecht / gist:4320534
Last active December 9, 2015 19:58
Set up MySQL and nginx on Centos 6
# Install MySQL
sudo yum install mysql mysql-server mysql-devel
sudo chkconfig --levels 235 mysqld on
sudo /etc/init.d/mysqld start
# Setup dbhost user
mysql -u root
GRANT ALL PRIVILEGES ON *.* TO 'dbhost'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
# Add dbhost 127.0.0.1 to /etc/hosts
@aghecht
aghecht / gist:4287602
Created December 14, 2012 18:43
Set up 32 or 64 bit Centos 6.3 to create a Vagrant base package