This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
public static class Extensions{ | |
public static IEnumerable<int> To(this int from, int to) | |
{ | |
for (int i = from; i <= to; i++) | |
{ | |
yield return i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sonatribe=> \dt public.* | |
List of relations | |
Schema | Name | Type | Owner | |
--------+----------------------------------------+-------+-------- | |
public | artist | table | stuser | |
public | artist_tags__tag_artists | table | stuser | |
public | attempt | table | stuser | |
public | auth | table | stuser | |
public | discoursesso | table | stuser | |
public | eventInstance | table | stuser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ListingEvent.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/#!documentation/models | |
*/ | |
module.exports = { | |
tableName: 'listingEvent', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ListingEvent.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/#!documentation/models | |
*/ | |
module.exports = { | |
tableName: 'listingEvent', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* FilteredLineupController | |
* | |
* @description :: Server-side logic for managing Filteredlineups | |
* @help :: See http://links.sailsjs.org/docs/controllers | |
*/ | |
var winston = require('winston'); | |
module.exports = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//ListingEvent.js | |
module.exports = { | |
tableName: 'listingEvent', | |
attributes: { | |
name: { type: 'string' }, | |
start: { type: 'date' }, | |
end: { type: 'date' }, | |
eventInstanceSlug: { type: 'string' }, | |
location: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var Waterline = require('waterline'); | |
var cloudinary = require('cloudinary'); | |
cloudinary.config({ | |
cloud_name: '****', | |
api_key: '****', | |
api_secret: '****' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using FluentNHibernate.Mapping; | |
using System.Collections.Generic; | |
using NHibernate; | |
using FluentNHibernate.Cfg; | |
using FluentNHibernate.Automapping; | |
using FluentNHibernate.Data; | |
using FluentNHibernate.Cfg.Db; | |
using NHibernate.Tool.hbm2ddl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public MemoryStream ZipStream(MemoryStream input){ | |
UIImage img = input.ToUIImage (); | |
img = img.Scale (new System.Drawing.SizeF (((img.Size.Width / 100) * 40), ((img.Size.Height / 100) * 40)), 0); | |
var compressed = img.AsJPEG(0.7f); | |
var minput = compressed.AsStream (); | |
MemoryStream zip = new MemoryStream (); | |
GZipStream zipper = new GZipStream (zip, CompressionMode.Compress); | |
minput.CopyTo(zipper); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public object Get(LineupRequest request) | |
{ | |
var response = new LineupResponse (); | |
var sw = new Stopwatch (); | |
sw.Start (); | |
using(var db = con.Open ()){ | |
var eventInstance = db.LoadSelect <Model.EventInstance>(q => q.Slug == request.Slug).FirstOrDefault (); | |
var locationIds = eventInstance.Locations.Select (x => x.Id); |