(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| name: Deploy to VPS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest |
| const data = startTrigger.data; | |
| const statusEmojis = { | |
| // github | |
| "queued": "⌛", | |
| "in_progress": "🏃♂️", | |
| "completed": "🚀", | |
| "failure": "❌", | |
| // heroku |
| const express = require('express'); | |
| const bodyParser = require('body-parser'); | |
| const app = express(); | |
| app.use(bodyParser.json()); | |
| app.use(bodyParser.urlencoded({ | |
| extended: true, | |
| })); | |
| // assume callback url is: http://localhost:3000/event |
| #!/bin/bash | |
| # This way you can customize which branches should be skipped when | |
| # prepending commit message. | |
| if [ -z "$BRANCHES_TO_SKIP" ]; then | |
| BRANCHES_TO_SKIP=(master develop test) | |
| fi | |
| BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
| BRANCH_NAME="${BRANCH_NAME##*/}" |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #define FCY 8000000UL // FCY = FOSC / 2 | |
| #include "libpic30.h" | |
| #include "stdio.h" | |
| #include "stdlib.h" | |
| #include "p30f2020.h" | |
| #include "xc.h" | |
| #include "config.h" | |
| int main(void){ | |
| U1BRG = 12; // 38400 baudrate |
| module.exports = { | |
| getAllStudents: function(cb){ | |
| Std.find({}, cb) | |
| }, | |
| getStudentByNIM: function(nim, cb){ | |
| Std.find({nim:nim}, function(err, student){ | |
| cb(null, student[0]) | |
| }) | |
| }, | |
| getStudentByLink: function(link, cb){ |
| async.waterfall([ | |
| function(callback){ | |
| queries.getStudentByNIM(nim, function(err, std){ | |
| msg = 'You are choosing ' + lecturerChosen + ' STATUS : PENDING' | |
| notifLength = std.notifs.length+1 | |
| callback(std[0]) | |
| }) | |
| }, | |
| function(callback){ | |
| queries.addNotif(nim, msg, notifLength, function(err){ |
| var mongoose = require('mongoose') | |
| var Schema = mongoose.Schema | |
| var lecturerSchema = new Schema ({ | |
| name: String, | |
| username: String, | |
| kk: String, | |
| kk_initial: String, | |
| img_url: String, |
| # Create your superuser | |
| $ mongo | |
| > use admin | |
| > db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
| > exit | |
| # Alias for convenience (optional and at your own risk) | |
| $ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
| $ source ~/.bash_profile |