Skip to content

Instantly share code, notes, and snippets.

View ruffle1986's full-sized avatar
🖖
live long

Tamas Fodor ruffle1986

🖖
live long
View GitHub Profile
@ruffle1986
ruffle1986 / node_nginx_ssl.md
Created February 10, 2022 17:35 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@ruffle1986
ruffle1986 / rebuild-metron-config-in-full-dev.md
Last active February 28, 2019 15:55
Rebuilding Metron is a very long process. If you have a tiny change in the config's UI code and you want to test in full dev, you should follow these steps.
  1. Go to the metron-config folder.

$ cd metron/metron-interface/metron-config

  1. Run the maven build taks

It creates a new build from the metron config UI with Maven and compresses it in a tar file. Once it's finished, you can find this file in the metron/metron-interface/metron-config/target folder. Suppose it's metron-config-0.7.1-archive.tar.gz.

const permissionMap = [
'canEditBilling',
'canSeeEveryArticle',
'editArticle',
'readArticle',
'canQuack'
];
roles = {
admin: {
@ruffle1986
ruffle1986 / real-time.jsx
Created April 9, 2018 13:50
real-time messaging with react
import React from 'react';
import PropTypes from 'prop-types';
import { render } from 'react-dom';
const realTimeServiceShape = PropTypes.shape({
subscribe: PropTypes.func.isRequired,
publish: PropTypes.func.isRequired,
getChannel: PropTypes.func.isRequired,
});
@ruffle1986
ruffle1986 / recursive-async.js
Created January 16, 2018 08:03
Recursive async function
/**
* Usage of async function you want to call recursively:
*
* 1. We're responsible for resolving our own promise in the recursive async func.
* 2. We would like to execute other commands after the invoncation of the recursive func (line #32).
*
* Since we're creating a brand new promise in the function body, if we want to execute other code after the initial
* recursive call, it's important to resolve the first promise when you want to exit the recursion. Otherwise, the code after
* the first call (line #32) won't be executed at all.
*/
const Item = (props) => (
<div className="item">
<img src={ props.picture.thumbnail } />
</div>
);
const List = (props) => (
<div>
{
props.items.map((item, i) => (
const multiply = (a, b) => a * b;
const logger = (wrapped) => (...args) => {
const result = wrapped(...args);
console.log('the result is ', result);
return result;
}

Intellyo services

Our services take place on Linode (https://linode.com)

hubot:

You can ssh the linode server where our hubot takes place

Frequently asked questions:

Q: What runs hubot?

React Users

(Javascript developer test exercise)


Here's the user database in the following format:

[
 {
import React from 'react';
class MyComponent extends React.Component {
state = {
data: 0
}
handleClick() {
const data = this.state.data;