Skip to content

Instantly share code, notes, and snippets.

View gngeorgiev's full-sized avatar
🦀

Georgi N. Georgiev gngeorgiev

🦀
View GitHub Profile
@gngeorgiev
gngeorgiev / el-validate.js
Last active August 29, 2015 14:16
Everlive Validation
define(['lodash'], function (_) {
'use strict';
var defaultValidators = {
$required: {
name: '$required',
attribute: 'ng-required',
cleanName: 'required',
validate: function (value) {
return !!value;
package realbase
import (
// "fmt"
// "gopkg.in/igm/sockjs-go.v2/sockjs"
// "net/http"
"gopkg.in/mgo.v2/bson"
)
func constructMessage(doc bson.M, operation string) bson.M {
@gngeorgiev
gngeorgiev / main.go
Created November 13, 2015 10:53
Twitter analyze spike
package main
import (
"github.com/ChimeraCoder/anaconda"
"net/url"
"fmt"
)
func main() {
anaconda.SetConsumerKey("54EgkqrPnKv8pVaKUhJhqmu3z")
anaconda.SetConsumerSecret("r2wBT4GzKyqkPU4kcYY9n3Omw0GnQHEGEFqN86dXLAnhkVuZEO")
async search(substring) {
const url = `${SEARCH_URL}${encodeURIComponent(substring)}`;
const response = await fetch(url);
const $ = cheerio.load(await response.text());
const videoElements = $(VIDEO_CLASS);
const getIdSelector = id => `${VIDEO_CLASS}[data-context-item-id=${id}]`;
return Array.from(videoElements).map((videoEl) => {
const id = videoEl.attribs['data-context-item-id'];
const idSelector = getIdSelector(id);
@gngeorgiev
gngeorgiev / sashido-parse-server-relations.js
Last active November 24, 2017 18:51
sashido-parse-server-relations.js
var Post = Parse.Object.extend('Post');
var myComment = new Comment();
myComment.set('content', 'Let\'s do Sushirrito.');
myComment.set('post', new Post());
myComment.save();
@gngeorgiev
gngeorgiev / sashido-parse-server-crud.js
Last active November 24, 2017 18:52
sashido-parse-server-crud.js
var GameScore = Parse.Object.extend('GameScore');
var gameScore = new GameScore();
gameScore.set('score', 1337);
//Create
gameScore.save().then(...);
@gngeorgiev
gngeorgiev / sashido-telerik-platform-CRUD.js
Last active November 24, 2017 18:52
sashido-telerik-platform-CRUD.js
var gameScore = everlive.data('GameScore');
//Create
gameScore.create({ score : 1337 }).then(...);
//Read
gameScore.getById('item-id').then(...);
@gngeorgiev
gngeorgiev / sashido-telerik-platform-relations.js
Last active November 24, 2017 18:53
sashido-telerik-platform-relations.js
var query = new Everlive.Query();
query.expand({
Post: {
TargetTypeName : 'Post'
}
});
@gngeorgiev
gngeorgiev / sashido-telerik-platform-push.js
Last active November 24, 2017 18:54
sashido-telerik-platform-push.js
everlive.push.notifications.create({
Filter: {
'Parameters.City': 'Tokyo'
},
Message: 'The Giants won against the Mets 2-3.'
}).then(...);
@gngeorgiev
gngeorgiev / sashido-parse-server-push.js
Last active November 24, 2017 18:55
sashido-parse-server-push.js
Parse.Push.send({
channels: [ 'Tokyo' ],
data: {
alert: 'The Giants won against the Mets 2-3.'
}
}).then(...);