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
| -module(asveloper_greeting_controller,[Req]). | |
| -compile(export_all). | |
| -title("Asveloper"). | |
| hello('GET',[])-> | |
| %%{json,[{greeting,"Hello Asveloper.... My First Web App in Erlang!"},{name,"Arslan Nasir"}]}. | |
| {ok,[{greeting,"Hello Asveloper.... My First Web App in Erlang!"},{name,"Arslan Nasir"}]}. |
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 db = require('monk'); | |
| /* | |
| ** MongoDB Driver for Botkit | |
| */ | |
| module.exports = function(config) { | |
| if (!config || !config.mongoUri) | |
| throw new Error('Need to provide mongo url.'); | |
| var Teams = db(config.mongoUri).get('teams'), |
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
| jobs.handleMessaging = function (messaging) { | |
| // only process incoming messages | |
| if (messaging.message || messaging.postback || messaging.optin) { | |
| const senderId = messaging.sender.id; | |
| return User | |
| .findOne({ fbId: senderId }) | |
| .then((user) => { | |
| if (!user) { |
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
| import { Meteor } from 'meteor/meteor'; | |
| import { Accounts } from 'meteor/accounts-base'; | |
| import { FlowRouter } from 'meteor/kadira:flow-router'; | |
| import React, { Component } from 'react'; | |
| import { NotificationManager } from 'react-notifications'; | |
| import autoBind from 'react-autobind'; | |
| import { | |
| Paper, | |
| Checkbox, | |
| RaisedButton, |
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
| import { Meteor } from 'meteor/meteor'; | |
| import { createContainer } from 'meteor/react-meteor-data'; | |
| import { Roles } from 'meteor/alanning:roles'; | |
| import { Counts } from 'meteor/tmeasday:publish-counts'; | |
| import { Ratings } from '../../api/ratings/ratings.js'; | |
| import { Favorites } from '../../api/favorites/favorites.js'; | |
| import { Subscriptions } from '../../api/subscriptions/subscriptions.js'; | |
| import { SubscriptionTypes } from '../../api/subscriptions/enums/types.js'; | |
| import { UserRoles } from '../../startup/both/business.js'; |
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
| class BusinessesController < ApplicationController | |
| before_action :check_due_payment, except: [:list] | |
| before_action :set_business, only: [:show, :profile, :edit, :update, :destroy] | |
| before_action :authenticate_user!, except: [:show, :profile, :list] | |
| # GET /businesses | |
| # GET /businesses.json | |
| def index | |
| @businesses = current_user.businesses | |
| authorize @businesses |
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
| # == Schema Information | |
| # | |
| # Table name: businesses | |
| # | |
| # id :integer not null, primary key | |
| # name :string(255) not null | |
| # phone :string(255) | |
| # category :string(255) not null | |
| # address :text not null | |
| # city :string(255) not null |
connect to meteor instance:
meteor mongo <name>.meteor.com
remove login tokens:
db.users.update({}, {$set: {"services.resume.loginTokens": []}}, {multi: true})
logout:
exit
more info: https://www.meteor.com/blog/2014/04/09/heartbleed
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
| #!/bin/sh | |
| # Make sure to: | |
| # 1) Name this file `backup.sh` and place it in /home/ubuntu | |
| # 2) Run sudo apt-get install awscli to install the AWSCLI | |
| # 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
| # 4) Fill in DB host + name | |
| # 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
| # 6) Run chmod +x backup.sh | |
| # 7) Test it out via ./backup.sh |
OlderNewer