Skip to content

Instantly share code, notes, and snippets.

View liorkesos's full-sized avatar
😎
chillin

Lior Kesos liorkesos

😎
chillin
View GitHub Profile
@liorkesos
liorkesos / CreateDocx.inc version header
Last active December 26, 2015 02:59
I run the phpdoc.php off a server and I've seen that the server has the pre-requisites (tidy and libxslt) in the server (see the php.ini)
?php
/**
* Generate a DOCX file
*
* @category Phpdocx
* @package create
* @copyright Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
* (http://www.2mdc.com)
* @license http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
$(document).ready(function() {
$.get("/0.1/user", function(data) {
window.user = data.user;
window.online = true;
window.bootstrap();
}).fail(function(jqXHR, textStatus, errorThrown) {
var userString = localStorage.getItem('ls.localUser');
window.user = JSON.parse(userString);
window.online = false;
@liorkesos
liorkesos / gist:7482918
Last active December 28, 2015 09:59
brainstorming on the script
#!/bin/bash
curl --silent --write-out '%{http_code}\n' "http://israelhayom.co.il/api/v2/getItems?class_id=1&format=json&order_by=popular&debug=static&real=1"
/**
* Module dependencies.
*/
var express = require('express'),
fs = require('fs'),
passport = require('passport'),
logger = require('mean-logger');
@liorkesos
liorkesos / admin.js
Created January 21, 2014 20:42
admin middleware..
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
async = require('async'),
_ = require('underscore');
exports.render = function(req, res) {
if (req.user) {
<section data-ng-controller="InstallationsController">
<form name="articleForm" class="form-horizontal col-md-6" role="form" data-ng-submit="articleForm.$valid && create()" novalidate>
<div class="form-group">
<label mean-token="'create-title'" class="col-md-3 control-label">Title</label>
<div class="col-md-9">
<input type="text" class="form-control" data-ng-model="title" id="title" placeholder="Title" required>
</div>
</div>
<div class="form-group">
<label mean-token="'create-content'" for="content" class="col-md-3 control-label">Content</label>
{
"name": "mean",
"description": "MEAN.io: A fullstack javascript platformed powerd by MongoDB, ExpressJS, AngularJS, NodeJS.",
"version": "0.3.3",
"private": false,
"author": "Linnovate <[email protected]>",
"contributors": [
{ "name": "Lior Kesos", "mail": "[email protected]" },
{ "name": "Yonatan Ellman", "mail": "[email protected]" },
{ "name": "Ehud Shahak", "mail": "[email protected]" },
β”œβ”€β”€ README.md
β”œβ”€β”€ app.js
β”œβ”€β”€ package.json
β”œβ”€β”€ public
β”‚Β Β  β”œβ”€β”€ assets
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ css
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── sonar.css
β”‚Β Β  β”‚Β Β  └── img
β”‚Β Β  β”‚Β Β  └── logo.png
β”‚Β Β  β”œβ”€β”€ controllers
@liorkesos
liorkesos / Articles controller
Last active August 29, 2015 14:02
Arricles packages
'use strict';
angular.module('mean').controller('ArticlesController', ['$scope', '$stateParams', '$location', 'Global', 'Articles',
function($scope, $stateParams, $location, Global, Articles) {
$scope.global = Global;
$scope.hasAuthorization = function(article) {
if (!article || !article.user) return false;
return $scope.global.isAdmin || article.user._id === $scope.global.user._id;
};
@liorkesos
liorkesos / config structure
Last active August 29, 2015 14:02
mean.io configuration server/config/env
config
β”œβ”€β”€ assets.json
β”œβ”€β”€ config.js
β”œβ”€β”€ env
β”‚Β Β  β”œβ”€β”€ all.js
β”‚Β Β  β”œβ”€β”€ development.js
β”‚Β Β  β”œβ”€β”€ production.js
β”‚Β Β  └── test.js
β”œβ”€β”€ express.js
β”œβ”€β”€ passport.js