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
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active June 22, 2024 09:34
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

@sardell
sardell / metron-get-updates.md
Last active February 18, 2019 16:16
Metron quick reset to get middleware and backend updates

WARNING: Doesn’t work for Ambari or Mpack updates

Here are the instructions for "quickly" getting middleware and backend updates without a full-dev rebuild:

  1. Run mvn clean install -Dskip from the root of your local metron project
  2. From metron-deployment/development/centos6, run vagrant scp ../../../metron-interface/metron-rest/target/metron-rest*.jar /tmp
  3. Log into vagrant by navigating into metron-deployment/development/centos6 and running vagrant ssh
  4. While ssh'd inside the vagrant machine, run sudo cp /tmp/metron-rest*.jar /usr/metron/$METRON_VERSION/lib
  5. Open a browser, visit Ambari (http://node1:8080) and reset (or start) METRON REST
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@ruffle1986
ruffle1986 / magic.js
Last active September 15, 2017 09:16
Magic script to test the loader on the research site
function magic() {
var script = document.createElement('script');
script.src = 'http://127.0.0.1:8080/loader.js';
document.body.appendChild(script);
}
magic();
@armw4
armw4 / redux-is-smarter-than-you-think.md
Last active June 19, 2021 20:10
Optimizing your react components via redux....shouldComponentUpdate for free and more...

The Beginning

Yes...it's true...redux is smart....smarter than you even know. It really does want to help you. It strives to be sane and easy to reason about. With that being said, redux gives you optimizations for free that you probably were completely unaware of.

connect()

connect is the most important thing in redux land IMO. This is where you tie the knot between redux and your underlying components. You usually take state and propogate it down your component hiearchy in the form of props. From there, presentational

@gaearon
gaearon / connect.js
Last active June 24, 2024 09:43
connect.js explained
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@diegoconcha
diegoconcha / redux_egghead_notes.md
Last active January 18, 2022 13:23
Redux Egghead.io Notes

###Redux Egghead Video Notes###

####Introduction:#### Managing state in an application is critical, and is often done haphazardly. Redux provides a state container for JavaScript applications that will help your applications behave consistently.

Redux is an evolution of the ideas presented by Facebook's Flux, avoiding the complexity found in Flux by looking to how applications are built with the Elm language.

####1st principle of Redux:#### Everything that changes in your application including the data and ui options is contained in a single object called the state tree

@bcoe
bcoe / npm-top.md
Last active June 16, 2024 08:40
npm-top.md

npm Users By Downloads (git.io/npm-top)


npm users sorted by the monthly downloads of their modules, for the range May 6, 2018 until Jun 6, 2018.

Metrics are calculated using top-npm-users.

# User Downloads