Skip to content

Instantly share code, notes, and snippets.

View mariohmol's full-sized avatar
:octocat:
lets make opensource!

Mario Mol mariohmol

:octocat:
lets make opensource!
View GitHub Profile
@mariohmol
mariohmol / mongooseGeo.js
Last active March 24, 2017 03:54
Trying to make geospatial queries in mongoose
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'testing_geojsonPoint23';
mongoose.connect('localhost', dbname);
var breeds={'chiuauahua': 0, 'bull terrier': 0, 'bulldog': 0, 'boxer': 0}
var questions = [
{
question: "1. What size you like?",
answers: ["small","big"],
results: { "small":["chiuauahua",'bull terrier'] , "big": ['bulldog','boxer'] }
},
{
@mariohmol
mariohmol / projecttips.md
Created March 3, 2017 18:51
Project Tips
  1. make a readme.md in the project with description, techs and a link for live (ghpges)
  2. make some comments and remove console.logs and revise the console for browser if have any errors
  3. try to make a landing page based on some ideas from https://land-book.com/gallery/landings
  4. check if have header with link and a good footer with links to the app, about you, github , twitter...
@mariohmol
mariohmol / gist:246eb67452e49fbebc35fd4b93098365
Last active November 29, 2016 17:23
How to use local mongo
@mariohmol
mariohmol / api.coursera.html
Last active July 2, 2016 02:55
How to consume Coursera API using jquery - example with courses and jsonp workaround
<html><body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
<script type="text/javascript">
$(function(){
$.ajax({
type: "GET",
url: "http://cors.io/",
data: {
u: "https://api.coursera.org/api/courses.v1?q=search&query=Philosophy"
}
@mariohmol
mariohmol / Gruntfile.js
Last active October 27, 2016 16:40
Configure Build grunt tasks for Strongloop + AngularJS + Bower modules
/*
* https://github.com/angular-fullstack/generator-angular-fullstack/blob/master/Gruntfile.js
* https://docs.strongloop.com/display/public/LB/AngularJS+Grunt+plugin
* http://amsterdam.luminis.eu/2014/12/10/improve-my-angularjs-project-with-grunt/
* https://github.com/olov/ng-annotate
* https://github.com/mgol/grunt-ng-annotate
* https://oclazyload.readme.io/docs
https://github.com/strongloop/loopback-example-offline-sync/blob/master/Gruntfile.js
@mariohmol
mariohmol / supervisord.conf
Created February 22, 2016 20:57
Supervisor conf for a node app
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
[program:myapp]
command=/usr/bin/node .
process_name=%(program_name)s
numprocs=1
@mariohmol
mariohmol / proxy.conf
Last active February 23, 2016 12:22
Configure Apache 2.4 + AngularJS + API (Stronloop LoopBack)
<VirtualHost *:80>
CustomLog /home/myapp/logs/wsgi.log common
ErrorLog /home/myapp/logs/error.log
LogLevel info
DocumentRoot /home/myapp/myclone/client
ServerName myapp.com
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f
<!doctype html>
<meta charset="utf-8">
<script src="http://www.d3plus.org/js/d3.js"></script>
<script src="http://www.d3plus.org/js/d3plus.js"></script>
<div id="viz"></div>
<script>