Skip to content

Instantly share code, notes, and snippets.

<skos:Concept rdf:about="http://udcdata.info/035546">
<skos:inScheme rdf:resource="http://udcdata.info/udc-schema"/>
<skos:broader rdf:resource="http://udcdata.info/035450"/>
<skos:notation rdf:datatype="http://udcdata.info/UDCnotation">581.4</skos:notation>
<skos:prefLabel xml:lang="be">Марфалогія раслінаў. Анатомія раслінаў</skos:prefLabel>
<skos:prefLabel xml:lang="bg">Морфология на растенията. Анатомия на растенията</skos:prefLabel>
<skos:prefLabel xml:lang="bn">উদ্ভিদের অঙ্গসংস্থান বিদ্যা। উদ্ভিদের শারীরস্থান</skos:prefLabel>
<skos:prefLabel xml:lang="ca">Morfologia vegetal</skos:prefLabel>
<skos:prefLabel xml:lang="cs">Morfologie rostlin. Anatomie rostlin</skos:prefLabel>
<skos:prefLabel xml:lang="de">Pflanzenmorphologie. Pflanzenanatomie</skos:prefLabel>
class Search
constructor: ->
@mysql = my.mysql
minimumLength = 4
standard: (query, cb) ->
query_values = query.split(' ')
query_build = []
for query_word in query_values
if query_word.length > (minimumLength - 1)
query_build.push "( SELECT *,'1' AS weight FROM videos WHERE status = 1 AND title LIKE " + @mysql.escape(query_word) + " )"
class videoHistory
constructor: ->
@mysql = my.mysql
debug = true;
# Push a video into the history // params = { videoId = XXXX [, userId = XXXX] }
push: (params, cb) ->
if not params.userId? then params.userId = '0'
if not params.videoId? then cb new Error 'videoId must be specified.'
params.timeNow = new Date()
@mysql.query '
doctype 5
html
head
title OpenShareIt
script(type="text/javascript", src="/javascripts/jquery.js")
link(rel='stylesheet', href='/stylesheets/styledan.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-2.0.4.css')
link(rel='stylesheet', href='/stylesheets/bootstrap/css/bootstrap.css')
link(rel='stylesheet', href='/stylesheets/bootstrap-resposnive-2.0.4.css')
extends layout
block content
.container
.row
.span12
h3= thread.title
for post in posts
.row
.span2
a(href='/user/#{post.user.username}')= post.user.username
Schema = my.mongoose.Schema
RatingSchema = new Schema
videoId: String
likes: [String]
dislikes: [String]
createdAt:
type: Date
default: Date.now
updatedAt:
@veteris
veteris / Comments_model.coffee
Created August 12, 2012 03:26
Comments model
Schema = my.mongoose.Schema
###
Comment.existsComment(commentId [, function(err, comment){...}])
If a callback function is not defined, simply returns true or false.
Comment.deleteComment(commentId, function(err){...})
Deletes a comment.
Comment.likeComment({userId: XXXX, commentId: XXXX} [, function(err, comment){...}])
Likes a comment.
@veteris
veteris / Course.coffee
Created July 28, 2012 13:20
Course model
class Course
constructor: ->
@mysql = my.get 'db'
create: (params, cb) ->
# Create a new course and enter it into the courses table
if not params.user_id?
throw new Error 'Err Course.create - User ID not defined.'
if not params.course?
throw new Error 'Err Course.create - Course name not defined.'
update: (params, cb) ->
# Update the properties of a video
if not params.id?
throw new Error 'Err Video.update - Video ID not defined.'
update_video:
updated: new Date
if params.title? then update_video.title = params.title
if params.description? then update_video.description = params.description
if params.category? then update_video.category = params.category
if params.tags? then update_video.tags = params.tags