Skip to content

Instantly share code, notes, and snippets.

View ichtrojan's full-sized avatar
🔺
The Nothing

Michael Okoh ichtrojan

🔺
The Nothing
View GitHub Profile
@ichtrojan
ichtrojan / web.php
Created December 3, 2017 12:32
Laravel Web Routes
<?php
Route::get('/food', function () {
return 'Give me Ewa-Agoyin';
});
@ichtrojan
ichtrojan / food.js
Created December 3, 2017 13:17
Food Route for ExpressJS
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('respond with a resource');
});
router.get('/trojan', function(req, res, next) {
res.send('i am trojan');
var express = require('express');
var router = express.Router();
/* GET food listing. */
router.get('/', function(req, res, next) {
res.send('Are you hungry');
});
module.exports = router;
@ichtrojan
ichtrojan / food.js
Created December 3, 2017 16:16
Beans
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.send('Are you Hungry?');
});
router.get('/beans', function(req, res, next) {
res.send('Yay Beans 😀');
@ichtrojan
ichtrojan / asynchronous.js
Created April 10, 2018 10:30 — forked from joepie91/asynchronous.js
PHP vs Node.js: Synchronous vs Asynchronous
console.log("Before the first file is read.");
hypotheticalFileGetContents("sample.txt", function(fileContents){
// fileContents now contains the file contents, this function is only called when the file read in the background has finished
console.log("After the first file has completed reading.");
});
// You've now told it to start the first read, but it won't 'block' your script execution. It will do the read in the background, and immediately move on with the rest of your code.
console.log("Before the second file is read.");
hypotheticalFileGetContents("sample2.txt", function(fileContents){
@ichtrojan
ichtrojan / class.cpp
Created September 30, 2018 14:18
Creating a simple class in C++
...
class human {
public:
string name;
int age;
};
...
@ichtrojan
ichtrojan / object.cpp
Created September 30, 2018 14:20
Creating a new object from a class in C++
#include <iostream>
using namespace std;
class human {
public:
string name;
int age;
};
int main () {
@ichtrojan
ichtrojan / object-part-two.cpp
Created September 30, 2018 14:24
Creating a second object from a class in C++
#include <iostream>
using namespace std;
class human {
 public:
string name;
int age;
};
int main () {
@ichtrojan
ichtrojan / behaviours.cpp
Created September 30, 2018 14:26
creating a behaviour in c++
#include <iostream>
using namespace std;
class human {
public:
string name;
int age;
void run () {
cout << name <<" is running" << endl;
#include <iostream>
using namespace std;
class human {
public:
string name;
int age;
void eat () {
cout << name <<" is eating" << endl;