Skip to content

Instantly share code, notes, and snippets.

View yesmeck's full-sized avatar
:octocat:
<img src="x" onerror="alert(1)" />

Wei Zhu yesmeck

:octocat:
<img src="x" onerror="alert(1)" />
View GitHub Profile
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev ruby1.9.3
gem install chef ruby-shadow bundler --no-ri --no-rdoc
@yesmeck
yesmeck / ngEnter.js
Last active September 2, 2015 09:11 — forked from EpokK/ngEnter.js
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)
@yesmeck
yesmeck / gist:947d19a82360c764d3e6
Created January 29, 2016 13:37 — forked from ebuildy/gist:5d4ad0998848eaefdad8
Setup sentry logger on a fresh Ubuntu server
sudo apt-get update
sudo apt-get install python-virtualenv libxslt1-dev libxml2
sudo apt-get install python-dev
sudo apt-get install postgresql
sudo apt-get install postgresql-server-dev-9.3
sudo apt-get install redis-server
sudo -u postgres createuser -s sentry
sudo -u postgres psql -c "alter user sentry with password 'sentry';"