This file contains hidden or 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
| <!doctype html> | |
| <html> | |
| <head> | |
| <style> | |
| /* container which maintains the ratio */ | |
| /* padding-bottom is the magic rule to set the aspect ration */ | |
| /* in this case below, this is a trick, to add padding bottom 50% but height 0 to compensate for the height created */ | |
| /* this will make the height of this container div always 50% of the width */ | |
| .container { |
This file contains hidden or 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
| /** | |
| * This function assumes string as a argument and | |
| * replaces everything between "START" and "END" | |
| * with "START";var __REPLACED = console.log('replaced');"END" | |
| * @param input string | |
| * @author Georgi Naumov | |
| * gonaumov@gmail.com for contacts and | |
| * suggestions. | |
| */ | |
| function replaceString(input) { |
This file contains hidden or 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 mongoose = require('mongoose'); | |
| var Schema = mongoose.Schema; | |
| //Database connection | |
| var uristring = 'mongodb://localhost/test'; | |
| var mongoOptions = { }; | |
| mongoose.connect(uristring, mongoOptions, function (err, res) { | |
| if (err) { | |
| console.log('Error when connecting to: ' + uristring + '. ' + err); |
This file contains hidden or 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 ghost = require( 'ghost' ) | |
| function processBuffer( buffer, app ){ | |
| while( buffer.length ){ | |
| var request = buffer.pop() | |
| app( request[0], request[1] ) | |
| } | |
| } | |
| function makeGhostMiddleware( options ){ |
This file contains hidden or 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
| ``` | |
| (function() { | |
| /** | |
| * @ngInject | |
| */ | |
| function ius($q, $ionicLoading, $cordovaFile, $translate, CLOUDINARY_CONFIGS) { | |
| var service = {}; |
This file contains hidden or 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 Pocket = require('./lib/pocket-auth.js'); | |
| var express = require('express'); | |
| var request = require('request'); | |
| var router = express.Router(); | |
| var auth = require('../../auth/auth.service'); | |
| var consumer_key = process.env.POCKET_KEY; | |
| var redirect_uri = process.env.DOMAIN + '/pocket/redirect'; | |
| var pocket = new Pocket({ |
This file contains hidden or 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 http = require("http"), | |
| url = require("url"), | |
| path = require("path"), | |
| fs = require("fs") | |
| port = process.argv[2] || 8888; | |
| http.createServer(function(request, response) { | |
| var uri = url.parse(request.url).pathname | |
| , filename = path.join(process.cwd(), uri); |
This file contains hidden or 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
| function prettyDate(time) { | |
| var date = new Date((time || "").replace(/-/g,"/").replace(/[TZ]/g," ")), | |
| diff = (((new Date()).getTime() - date.getTime()) / 1000), | |
| day_diff = Math.floor(diff / 86400); | |
| if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 ){ | |
| return; |
NewerOlder