Skip to content

Instantly share code, notes, and snippets.

View jrichardsz's full-sized avatar

JRichardsz jrichardsz

View GitHub Profile
@jrichardsz
jrichardsz / 0-react-hello-world.md
Created May 20, 2016 16:50 — forked from danawoodman/0-react-hello-world.md
React Hello World Examples

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

@jrichardsz
jrichardsz / gist:0b7f55ae9ab2441135c54a29690af9ba
Created July 8, 2016 15:34 — forked from ivan-loh/gist:ee0d96c3795e59244063
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb
@jrichardsz
jrichardsz / install-comodo-ssl-cert-for-nginx.rst
Created July 14, 2016 20:48 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@jrichardsz
jrichardsz / standalone.xml
Created September 22, 2016 22:26
http request access logs jboss As 7
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
<access-log pattern="%a %t %H %p %U %s " >
<directory relative-to="jboss.server.log.dir" />
</access-log>
</virtual-server>
</subsystem>
@jrichardsz
jrichardsz / API.md
Last active July 20, 2023 15:03 — forked from iros/API.md
Documenting your REST API, api docs, apidocs, restdocs, http spec, documentation, wiki

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

Espacio3D esp = new Espacio3D();
Human human = new Human(HumanTemplates.default);
esp.add(human, location, zoom, option1,...);
AndroidViewContainer.add(human);
public class Cube
private float vertices[] =
-1.0f, -1.0f, -1.0f,
1.0f, -1.0f, -1.0f,
1.0f, 1.0f, -1.0f,
...
public class OpenGLRenderer implements Renderer {
private Cube mCube = new Cube();
private float mCubeRotation;
...
GLSurfaceView view = new GLSurfaceView(this);
view.setRenderer(new OpenGLRenderer());
setContentView(view);
@jrichardsz
jrichardsz / or.jrichardsz.TestMavenPomEdit
Created January 19, 2017 00:40
How to edit a maven POM at runtime? How to edit a maven POM file? Add dinamically plugins to maven pom file.
package or.jrichardsz;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.Writer;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;