Author: g1a34yvolves

  • fiftypercent

    50 Percent wants to document how much women* are misrepresented as speakers at conferences, on panels, in talkshows and many other public events. At each event we count male and female speakers and publish the percentage of each – with your help!

    It is a Rails application maintained by the rubymonstas.

    See also: Speakerinnen and the blog

    Build Status

    Development setup

    Time to open your Terminal! 👩‍💻

    1. Clone the project git clone git@github.com:rubymonsters/fiftypercent.git
    2. Switch to the project folder cd fiftypercent
    3. Create your own database file cp config/database_example.yml config/database.yml
    4. Install Postgres for the database following their guide for your operating system
      sudo su - postgres # log in with the postgres user
      psql # enter the Postgres database
      CREATE ROLE yourusername; # create a new user
      ALTER ROLE yourusername WITH LOGIN CREATEDB; # give necessary rights to database user
      
    5. Make sure you have the correct Ruby version installed. We recommend Ruby Version Manager (RVM) (you can also use rbenv, but setup is more difficult). Also best uninstall any Ruby installation from your operating system as it might conflict. Run these commands to install RVM and switch to Ruby 2.4.2 which we use:
      gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
      \curl -sSL https://get.rvm.io | bash -s stable
      rvm install "ruby-2.4.2"
      
    6. Install bundler gem install bundler
    7. Install dependencies using bundle install
    8. Create the database
      rake db:create
      rake db:migrate
      
    9. Start the server with rails s
    10. Open your browser and go to http://0.0.0.0:3000

    🎉 Now you are set up to contribute code! 🙂

    • Once you made changes, you can run the tests with rake test.
    • The code can be deployed to production using cap production deploy. If you want to deploy a specific branch, use cap production deploy BRANCH=branchname
    Visit original content creator repository https://github.com/rubymonsters/fiftypercent
  • mt4-web-trader

    mt4-web-trader

    Backend part of web trader based on mt4 manager api

    Endpoints

    Symbols

    GET /symbols

    retrun:

    {
      "data": ["EURUSD","GBPUSD"]
    }

    Symbols history data

    GET /symbols/{symbol}/{period}/{from}/{count}

    return:

    {
      "symbol": "EURUSD",
      "period": "M1",
      "data": [
      {
        "time": 1231313,
        "bid": 1.222,
        "ask": 1.333,
        "o": 1.444,
        "h": 1.333,
        "l": 1.555,
        "c": 1.666
      }
      ]
    }

    User authorize

    POST /auth/login

    params: login, passowrd

    returns:

    {
      "code": 0,
      "expire": "string",
      "token": "string"
    }

    Trades. Returns live trades

    GET trades/{login}

    headers: Authorization {token}

    returns:

    {
      "close_price": 0,
      "close_time": 0,
      "cmd": 0,
      "comment": "string",
      "digits": 0,
      "expiration": 0,
      "login": 0,
      "magic": 0,
      "open_price": 0,
      "open_time": 0,
      "profit": 0,
      "sl": 0,
      "symbol": "string",
      "ticket": 0,
      "tp": 0,
      "volume": 0
    }

    Trades. Update open trade

    headers: Authorization {token}

    PATCH trades/update

    params:

    {
      "price": 1.1456,
      "sl": 1.1456,
      "ticket": 101,
      "tp": 1.1456
    }

    return:

    {
      "code": 400,
      "message": "status bad request"
    }

    Trades. CLose open trade

    PATCH /trades/close

    headers: Authorization {token}

    params:

    {
      "ticket": 101,
      "volume": 0.1
    }

    return:

    {
      "code": 400,
      "message": "status bad request"
    }

    Websocket endponts

    Quotes

    real-time quotes

    path: /ws/quotes

    header: manager token

    data:

    {
    	"symbol": "EURUSD",
    	"ask": 1.1212,
    	"bid": 1.111,
    	"time": 123123213
    }

    Trades

    real-time event of trade. open, close, modify

    path: /ws/trades

    header: token

    data:

    {
    	"ticket": 1,
    	"symbol": "",
    	"digits": 4,
    	"cmd": 1,
    	"volume":0.1,
    	"open_time": 12313,
    	"open_price": 1.1232,
    	"close_time": 12313,
    	"close_price": 1.23232,
    	"sl": 1.23424,
    	"tp": 1.2323,
    	"comment": "test",
    	"expiration": 123123,
    	"profit": 45.44,
    	"magic": 123
    }

    Trade Profits

    real-time event of each trade P/L update

    path: /ws/trade_profits

    header: token

    data:

    {
      "ticket": 12123,
      "pl": 12.23
    }

    Margins

    real-time update of user marging, balance,

    path: /ws/margins

    header: token

    data:

    {
      "balance": 12.22,
      "margin": 23.22,
      "free_margin": 32.23
    }

    Visit original content creator repository
    https://github.com/mikha-dev/mt4-web-trader

  • scrap

    Scrap

    Scrapping Facebook with JavaScript.

    Scrap

    How to use

    Go to a Facebook page where there’s a list of people with pictures of them. e.g.: someone’s friends, group participants…

    Open the console. In Chrome is ctrl + shift + j

    Copy and paste the script, hit enter.

    Wait. As my internet is kinda slow, I choose a 3 second time interval between each page scroll, to give it more time to load; but you can change that.

    Search

    Find people on Facebook by photo.

    Search

    The audio on the video below is in portuguese. And it’s almost all blurred, cause I dont know if I can show other people on my videos

    How to use

    Set the varible imgToFind with the address of the picture you want to search.

    Go to a Facebook page where there’s a list of people with pictures of them. e.g.: someone’s friends, group participants…

    Open the console. In Chrome is ctrl + shift + j

    Copy and paste the script, hit enter.

    The script will log the probables results.

    DISCLAIMER

    I’m not responsable for anything you do with these scripts.

    Visit original content creator repository https://github.com/victorqribeiro/scrap
  • next-buy-me-a-beer

    This is a Next.js project bootstrapped with create-next-app.

    Getting Started

    First, run the development server:

    npm run dev
    # or
    yarn dev

    Open http://localhost:3000 with your browser to see the result.

    You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.

    API routes can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in pages/api/hello.ts.

    The pages/api directory is mapped to /api/*. Files in this directory are treated as API routes instead of React pages.

    This project uses next/font to automatically optimize and load Inter, a custom Google Font.

    Learn More

    To learn more about Next.js, take a look at the following resources:

    You can check out the Next.js GitHub repository – your feedback and contributions are welcome!

    Deploy on Vercel

    The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

    Check out our Next.js deployment documentation for more details.

    Visit original content creator repository
    https://github.com/janosnanai/next-buy-me-a-beer

  • NLP-CaseStudy-Amazon-Fine-Foods-Review

    NLP Case Study – Amazon Fine Foods Review (Text Vectorization/Featurization Techniques)

    Efficient sentence encoding and vectorization techniques with customer reviews on a product page of the popular E-Commerce website, Amazon using proven NLP techniques for the purpose of sentiment analysis. The resulting sentence vectors can be easily used with any popular linear/non-linear classification techniques, decision-tree based methods, ensemble methods or neural networks.

    This is just an implementation of the state-of-the-art text featurization techniques.

    Objective

    Given a review, determine whether the review is positive (Rating of 4 or 5) or negative (rating of 1 or 2).

    Since the product rating out of 5 is also given, we can use this score to deduce the posivity/negativity for ground truth. A rating of 4 or 5 could be cosnidered a positive review. A review of 1 or 2 could be considered negative. A review of 3 is nuetral and ignored. This is an approximate and proxy way of determining the polarity (positivity/negativity) of a review.

    Dataset

    Dataset Link

    The dataset is available in two forms

    1. .csv file
    2. SQLite Database

    In order to load the data, We have used the SQLITE dataset as it easier to query the data and visualise the data efficiently.
    Here as we only want to get the global sentiment of the recommendations (positive or negative), we will purposefully ignore all Scores equal to 3. If the score id above 3, then the recommendation wil be set to “positive”. Otherwise, it will be set to “negative”.

    Dataset Details

    Basic EDA Reference Blog

    The Amazon Fine Food Reviews dataset consists of reviews of fine foods from Amazon.

    Number of reviews: 568,454
    Number of users: 256,059
    Number of products: 74,258
    Timespan: Oct 1999 – Oct 2012
    Number of Attributes/Columns in data: 10

    Attribute Information:

    1. Id
    2. ProductId – unique identifier for the product
    3. UserId – unqiue identifier for the user
    4. ProfileName
    5. HelpfulnessNumerator – number of users who found the review helpful
    6. HelpfulnessDenominator – number of users who indicated whether they found the review helpful or not
    7. Score – rating between 1 and 5
    8. Time – timestamp for the review
    9. Summary – brief summary of the review
    10. Text – text of the review

    Visit original content creator repository
    https://github.com/somjit101/NLP-CaseStudy-Amazon-Fine-Foods-Review

  • moodle-webservice_restful

    ci

    moodle-webservice_restful

    A REStful webservice plugin for Moodle LMS

    This plugin allows Moodle’s webservice interface to operate in a more RESTFul way.
    Instead of each webservice call having a URL query parameter define what webservice function to use, webservice functions are made available by discrete URLS.

    This makes it easier to integrate Moodle with modern interfaces that expect a RESTful interface from other systems.

    This plugin also supports sending requests to Moodle webservices using the JSON format.

    Finally, by default all Moodle webservice requests return the HTTP status code of 200 regardless of the success or failure of the call. This plugin will return 4XX series status codes if calls are malformed, missing data or unauthorised. This allows external services communicating with Moodle to determine the success or failure of a webservice call without the need to parse the body of the response.

    Why make this Plugin?

    There were two related reasons for making this plugin. The first was to solve a technical problem; interfacing Moodle to a service that required each Moodle webservice to be callable from a unique URL. The second was to advance the maturity of Moodle’s webservice interface.

    The “Richardson Maturity Model” (https://martinfowler.com/articles/richardsonMaturityModel.html) describes the maturity of a web applications API/ webservice interface in a series of levels.

    Maturity Model

    Moodle is currently Level 0 or in the “swamp of POX”. As described be Fowler, Moodle “is using HTTP as a tunneling mechanism for your own remote interaction mechanism”

    This plugin aims to extend the maturity of Moodle’s webservice interface to “Level 1: Resources” by making each webservice function available as a discrete URL.

    Supported Moodle Versions

    Moodle version Branch
    Moodle 4.2 – 4.4 MOODLE_402_STABLE
    Moodle 3.9 – 4.1 master

    Moodle Plugin Installation

    The following sections outline how to install the Moodle plugin.

    Command Line Installation

    To install the plugin in Moodle via the command line: (assumes a Linux based system)

    1. Get the code from GitHub or the Moodle Plugin Directory.
    2. Copy or clone code into: <moodledir>/webservice/restful
    3. Run the upgrade: sudo -u www-data php admin/cli/upgrade Note: the user may be different to www-data on your system.

    User Interface Installation

    To install the plugin in Moodle via the Moodle User Interface:

    1. Log into your Moodle as an Administrator.
    2. Navigate to: Site administration > Plugins > Install Plugins
    3. Install plugin from Moodle Plugin directory or via zip upload.

    Moodle Plugin Setup

    Once the plugin has been installed in Moodle, the following minimal setup is required:

    1. Log into your Moodle as an Administrator.
    2. Navigate to: Site administration > Plugins > Webservices > Manage protocols
    3. Enable the RESTful protocol by clicking the “eye icon” in the enable column for this protocol.

    Moodle Webservice Setup

    Follow these instructions if you do not currently have any webservies enabled and/or unfamiliar with Moodle webservices.

    There are several steps required to setup and enable webservices in Moodle, these are covered in the Moodle documentation that can be found at: https://docs.moodle.org/34/en/Using_web_services

    It is recommended you read through these instructions first before attempting Moodle webservice Setup.

    Accepted Content Types

    Data can be sent to Moodle webservices using the following encodings:

    • application/json
    • application/xml
    • application/x-www-form-urlencoded

    Use the ‘Content-Type’ HTTP header to notify Moodle which format is being used per request.

    Returned Content Types

    Data can be received from Moodle webservices using the following encodings:

    • application/json
    • application/xml

    Use the ‘Accept’ HTTP header to notify Moodle which format to return per request.

    Differences to Moodle Standard Webservice Interface

    When using the RESTful plugin there are several differences to other Moodle webservice plugins, these are summarised below:

    • Webservice function as URL (slash parameter) ** Instead of being passed as a query parameter webservice functions are passed in the URL, e.g. https://localhost/webservice/restful/server.php/core_course_get_courses this allows each webservice to appear as a unique URL endpoint.
    • Webservice authorisation token as HTTP header ** Instead of being passed as a query parameter, authorisation tokens are passed using the ‘Authorization’ HTTP Header.
    • Moodle response format as HTTP header ** Instead of being passed as a query parameter, the desired Moodle response format ispassed using the ‘Accept’ HTTP Header.

    Sample Webservice Calls

    Below are several examples of how to structure requests using the cURL command line tool.

    JSON Request

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle and the response received back are both in JSON format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H 'Authorization: {token}' \
    -d'{"options": {"ids":[6]}}' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    XML Request

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle and the response received back are both in XML format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/xml" \
    -H "Accept: application/xml" \
    -H 'Authorization: {token}' \
    -d'
    <root>
       <options>
          <ids>
             <element>6</element>
          </ids>
       </options>
    </root>' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    REST / Form Request

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle is in REST format and the response received back is in JSON format.

    NOTE: This plugin can only accept requests in REST format. Responses must be in JSON or XML format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Accept: application/json" \
    -H 'Authorization: {token}' \
    -d'options[ids][0]=6' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    Mixed Request and Response

    This Moodle webservice plug-in allows for requests and responses to be different formats.

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle is in JSON format and the response received back is in XML format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/xml" \
    -H 'Authorization: {token}' \
    -d'{"options": {"ids":[6]}}' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    The received response will look like:

    
    <RESPONSE>
    <MULTIPLE>
    <SINGLE>
    <KEY name="id"><VALUE>6</VALUE>
    </KEY>
    <KEY name="shortname"><VALUE>search test</VALUE>
    </KEY>
    <KEY name="categoryid"><VALUE>1</VALUE>
    </KEY>
    <KEY name="categorysortorder"><VALUE>10003</VALUE>
    </KEY>
    ...
    

    Error Examples

    The following cURL example will generate various types of errors. These are useful when testing.

    No Aauthorization Header

    This request is missing the authorization header.

    
    curl -i -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d'{"options": {"ids":[6]}}' \
    "http://moodle.local/webservice/restful/server.php/core_course_get_courses"
    

    Invalid Token

    This request contains an invalid webservice token.

    
    curl -i -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H 'Authorization: xxx' \
    -d'{"options": {"ids":[6]}}' \
    "http://moodle.local/webservice/restful/server.php/core_course_get_courses"
    

    No Accept Header

    This request is missing the Accept header.

    
    curl -i -X POST \
    -H -i "Content-Type: application/json" \
    -H 'Authorization: e71561c88ca7f0f0c94fee66ca07247b' \
    -d'{"options": {"ids":[6]}}' \
    "http://moodle.local/webservice/restful/server.php/core_course_get_courses"
    

    Roadmap

    The next big step will be to update the interface to “Level 2” that is support HTTP verbs, like get and post.
    Which verb to use will likely be dependant on the ws function name that is being invoked.

    If you have any suggestions for functionality, they can be requests by raising a GitHub issue: https://github.com/catalyst/moodle-webservice_restful/issues

    Crafted by Catalyst IT

    This plugin was developed by Catalyst IT Australia:

    https://www.catalyst-au.net/

    Catalyst IT

    Contributing and Support

    Issues, and pull requests using github are welcome and encouraged!

    https://github.com/catalyst/moodle-webservice_restful/issues

    If you would like commercial support or would like to sponsor additional improvements to this plugin please contact us:

    https://www.catalyst-au.net/contact-us

    Visit original content creator repository https://github.com/catalyst/moodle-webservice_restful
  • moodle-webservice_restful

    ci

    moodle-webservice_restful

    A REStful webservice plugin for Moodle LMS

    This plugin allows Moodle’s webservice interface to operate in a more RESTFul way.
    Instead of each webservice call having a URL query parameter define what webservice function to use, webservice functions are made available by discrete URLS.

    This makes it easier to integrate Moodle with modern interfaces that expect a RESTful interface from other systems.

    This plugin also supports sending requests to Moodle webservices using the JSON format.

    Finally, by default all Moodle webservice requests return the HTTP status code of 200 regardless of the success or failure of the call. This plugin will return 4XX series status codes if calls are malformed, missing data or unauthorised. This allows external services communicating with Moodle to determine the success or failure of a webservice call without the need to parse the body of the response.

    Why make this Plugin?

    There were two related reasons for making this plugin. The first was to solve a technical problem; interfacing Moodle to a service that required each Moodle webservice to be callable from a unique URL. The second was to advance the maturity of Moodle’s webservice interface.

    The “Richardson Maturity Model” (https://martinfowler.com/articles/richardsonMaturityModel.html) describes the maturity of a web applications API/ webservice interface in a series of levels.

    Maturity Model

    Moodle is currently Level 0 or in the “swamp of POX”. As described be Fowler, Moodle “is using HTTP as a tunneling mechanism for your own remote interaction mechanism”

    This plugin aims to extend the maturity of Moodle’s webservice interface to “Level 1: Resources” by making each webservice function available as a discrete URL.

    Supported Moodle Versions

    Moodle version Branch
    Moodle 4.2 – 4.4 MOODLE_402_STABLE
    Moodle 3.9 – 4.1 master

    Moodle Plugin Installation

    The following sections outline how to install the Moodle plugin.

    Command Line Installation

    To install the plugin in Moodle via the command line: (assumes a Linux based system)

    1. Get the code from GitHub or the Moodle Plugin Directory.
    2. Copy or clone code into: <moodledir>/webservice/restful
    3. Run the upgrade: sudo -u www-data php admin/cli/upgrade Note: the user may be different to www-data on your system.

    User Interface Installation

    To install the plugin in Moodle via the Moodle User Interface:

    1. Log into your Moodle as an Administrator.
    2. Navigate to: Site administration > Plugins > Install Plugins
    3. Install plugin from Moodle Plugin directory or via zip upload.

    Moodle Plugin Setup

    Once the plugin has been installed in Moodle, the following minimal setup is required:

    1. Log into your Moodle as an Administrator.
    2. Navigate to: Site administration > Plugins > Webservices > Manage protocols
    3. Enable the RESTful protocol by clicking the “eye icon” in the enable column for this protocol.

    Moodle Webservice Setup

    Follow these instructions if you do not currently have any webservies enabled and/or unfamiliar with Moodle webservices.

    There are several steps required to setup and enable webservices in Moodle, these are covered in the Moodle documentation that can be found at: https://docs.moodle.org/34/en/Using_web_services

    It is recommended you read through these instructions first before attempting Moodle webservice Setup.

    Accepted Content Types

    Data can be sent to Moodle webservices using the following encodings:

    • application/json
    • application/xml
    • application/x-www-form-urlencoded

    Use the ‘Content-Type’ HTTP header to notify Moodle which format is being used per request.

    Returned Content Types

    Data can be received from Moodle webservices using the following encodings:

    • application/json
    • application/xml

    Use the ‘Accept’ HTTP header to notify Moodle which format to return per request.

    Differences to Moodle Standard Webservice Interface

    When using the RESTful plugin there are several differences to other Moodle webservice plugins, these are summarised below:

    • Webservice function as URL (slash parameter) ** Instead of being passed as a query parameter webservice functions are passed in the URL, e.g. https://localhost/webservice/restful/server.php/core_course_get_courses this allows each webservice to appear as a unique URL endpoint.
    • Webservice authorisation token as HTTP header ** Instead of being passed as a query parameter, authorisation tokens are passed using the ‘Authorization’ HTTP Header.
    • Moodle response format as HTTP header ** Instead of being passed as a query parameter, the desired Moodle response format ispassed using the ‘Accept’ HTTP Header.

    Sample Webservice Calls

    Below are several examples of how to structure requests using the cURL command line tool.

    JSON Request

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle and the response received back are both in JSON format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H 'Authorization: {token}' \
    -d'{"options": {"ids":[6]}}' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    XML Request

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle and the response received back are both in XML format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/xml" \
    -H "Accept: application/xml" \
    -H 'Authorization: {token}' \
    -d'
    <root>
       <options>
          <ids>
             <element>6</element>
          </ids>
       </options>
    </root>' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    REST / Form Request

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle is in REST format and the response received back is in JSON format.

    NOTE: This plugin can only accept requests in REST format. Responses must be in JSON or XML format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -H "Accept: application/json" \
    -H 'Authorization: {token}' \
    -d'options[ids][0]=6' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    Mixed Request and Response

    This Moodle webservice plug-in allows for requests and responses to be different formats.

    The following example uses the core_course_get_courses webservice function to get the course with id 6. The request sent to Moodle is in JSON format and the response received back is in XML format.

    To use the below example against an actual Moodle instance:

    • Replace the {token} variable (including braces) with a valid Moodle authorisation token.
    • Relace localhost in the URL in the example with the domain of the Moodle instance you want to use.
    
    curl -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/xml" \
    -H 'Authorization: {token}' \
    -d'{"options": {"ids":[6]}}' \
    "https://localhost/webservice/restful/server.php/core_course_get_courses"
    

    The received response will look like:

    
    <RESPONSE>
    <MULTIPLE>
    <SINGLE>
    <KEY name="id"><VALUE>6</VALUE>
    </KEY>
    <KEY name="shortname"><VALUE>search test</VALUE>
    </KEY>
    <KEY name="categoryid"><VALUE>1</VALUE>
    </KEY>
    <KEY name="categorysortorder"><VALUE>10003</VALUE>
    </KEY>
    ...
    

    Error Examples

    The following cURL example will generate various types of errors. These are useful when testing.

    No Aauthorization Header

    This request is missing the authorization header.

    
    curl -i -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d'{"options": {"ids":[6]}}' \
    "http://moodle.local/webservice/restful/server.php/core_course_get_courses"
    

    Invalid Token

    This request contains an invalid webservice token.

    
    curl -i -X POST \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H 'Authorization: xxx' \
    -d'{"options": {"ids":[6]}}' \
    "http://moodle.local/webservice/restful/server.php/core_course_get_courses"
    

    No Accept Header

    This request is missing the Accept header.

    
    curl -i -X POST \
    -H -i "Content-Type: application/json" \
    -H 'Authorization: e71561c88ca7f0f0c94fee66ca07247b' \
    -d'{"options": {"ids":[6]}}' \
    "http://moodle.local/webservice/restful/server.php/core_course_get_courses"
    

    Roadmap

    The next big step will be to update the interface to “Level 2” that is support HTTP verbs, like get and post.
    Which verb to use will likely be dependant on the ws function name that is being invoked.

    If you have any suggestions for functionality, they can be requests by raising a GitHub issue: https://github.com/catalyst/moodle-webservice_restful/issues

    Crafted by Catalyst IT

    This plugin was developed by Catalyst IT Australia:

    https://www.catalyst-au.net/

    Catalyst IT

    Contributing and Support

    Issues, and pull requests using github are welcome and encouraged!

    https://github.com/catalyst/moodle-webservice_restful/issues

    If you would like commercial support or would like to sponsor additional improvements to this plugin please contact us:

    https://www.catalyst-au.net/contact-us

    Visit original content creator repository https://github.com/catalyst/moodle-webservice_restful
  • MPGSMerchantServer

    MPGS Merchant Server

    Build Status Go Report Card

    Merchant Server Component for the MPGS SDK

    Deploy via Heroku

    Deploy

    Deploy via Docker

    The sample docker-compose.yml can be used by simply running docker-compose up -d or the port can be altered by changing the mapping according to the Docker Port Specification. Set the environment variables with your Mastercard Payment Gateway Services information.

    API Specification

    Client Authentication is handled in the Auth method of the handlers.go file. By default this is a Header of “APIKEY” with a value of “TESTSDK”. Feel free to modify this if necessary.

    clientAuth

    Operation URL HTTP Method Authentication Request Response
    Index “https://github.com/” GET APIKEY Header N/A N/A, Only Generates Log Output
    Start Payment ‘/startpayment’ POST APIKEY Header N/A “id”: “SessionID/NONE”, “result”: “SUCCESS/FAILURE”
    Finish Payment ‘/finishpayment’ PUT APIKEY Header “id”: “SessionID” “id”: “SessionID”, “result”: “SUCCESS/FAILURE”

    Disclaimer

    All service calls responsible for handling payment information should use best-in-class security practices. This software is intended for TEST / DEVELOPMENT purposes ONLY and is not intended to be used in a production environment. This app should only serve to satisfy the following use cases:

    • As a complimentary tool for the sample mobile apps when demonstrating functionality.
    • As a stop-gap solution for developers integrating their apps with the mobile SDKs and do not yet have service components in place to support an entire transaction lifecycle.
    Visit original content creator repository https://github.com/dangeroustech/MPGSMerchantServer
  • Movie-Website

    Getting Started with Create React App

    This project was bootstrapped with Create React App.

    Available Scripts

    In the project directory, you can run:

    npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in your browser.

    The page will reload when you make changes.
    You may also see any lint errors in the console.

    npm test

    Launches the test runner in the interactive watch mode.
    See the section about running tests for more information.

    npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

    npm run eject

    Note: this is a one-way operation. Once you eject, you can’t go back!

    If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

    You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

    Learn More

    You can learn more in the Create React App documentation.

    To learn React, check out the React documentation.

    Code Splitting

    This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

    Analyzing the Bundle Size

    This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

    Making a Progressive Web App

    This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

    Advanced Configuration

    This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

    Deployment

    This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

    npm run build fails to minify

    This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

    Visit original content creator repository
    https://github.com/Arpitkumar504/Movie-Website

  • congo

    Congo

    Congo is the MongoDb Explorer written by @robconery as part of Tekpub’s Backbone.serie and now available on Pluralsight course https://app.pluralsight.com/library/courses/playing-with-backbonejs/

    The original application : https://github.com/robconery/congo

    BackboneJS

    If you follow the Pluralsight course with the most recent versions of Backbone, Mongoskin and Marionette you will quickly run into trouble as those libraries has evolved over time. Unfortunatelly, the application on Rob’s repository was not upgraded since then.

    While I was fallowing the course, I’ve upgraded parts of the application to use the newest Backbone.js v1.3.3 at this time. Also updating parts of Mongoskin as access to MongoDb has slightly changed.

    MarionetteJS

    There is no code for MarionetteJS part in Rob’s repo. I’ve implemented it following the last section using the latest MarionetteJS v3.3.1, but there were some noticable differences between the current version and one used in the videos.

    Other changes

    As I said most important changes were in BackboneJS and MarionetteJS but also many changes were done to Mongoskin and Express. I’ve also replaced Jade view engine by Pug with some minor changes in the syntax.

    Enjoy !

    Visit original content creator repository
    https://github.com/tjaskula/congo