Skip to content

Instantly share code, notes, and snippets.

View rschwabco's full-sized avatar

Roie Schwaber-Cohen rschwabco

  • Galileo
  • Seattle, WA
View GitHub Profile
app.all('/api/*',function(req,res){
try{
var controller = toUpperCase(req.query['controller']),
action = toUpperCase(req.query['action']),
method = (req.query['method']) ? req.query['method'].toLowerCase():'get';
var currentController = require('./routes/'+controller+'.js');
app[method].call(this,'/',currentController[action]);
}catch(e){
function HeaderController($scope, $location, Global) {
$scope.global = Global;
$scope.menu = [{
"title": "Tasks",
"link": "tasks"
}, {
"title": "Deals",
"link": "deals"
}];
@rschwabco
rschwabco / gist:9342150
Last active August 29, 2015 13:56
Mean-SEO
var seo = require('mean-seo')
app.use(seo());
var seo = require('mean-seo');
app.use(seo({
cacheClient: 'disk', // Can be 'disk' or 'redis'
cacheDuration: 2 * 60 * 60 * 24 * 1000, // In milliseconds for disk cache
}));
// app.use(app.router) will be below this line
npm install mean-seo
@rschwabco
rschwabco / ng-hide-animation-mixin.scss
Created May 22, 2014 19:03
Ng-hide animation Sass Mixin
@mixin angular-animate-hide($duration,$property,$easing,$min-val,$max-val){
transition :$duration $property $easing;
&.ng-hide-add,&.ng-hide-remove{
display: block !important;
#{$property}: $min-val;
}
&.ng-hide-remove.ng-hide-remove-active{
#{$property}: $max-val;
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="name-tag">
<template>
<style>
</style>
<b>{{ owner }}</b>
</template>
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="name-tag">
<template>
This is <b>{{owner}}</b>'s name-tag element.
</template>
<script>
Polymer('name-tag', {
// initialize the element's model
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;