Skip to content

Instantly share code, notes, and snippets.

View eriknyk's full-sized avatar
🏠
Working from home

Erik Amaru Ortiz eriknyk

🏠
Working from home
View GitHub Profile
@eriknyk
eriknyk / gist:4182919
Last active October 13, 2015 10:38 — forked from o1y/gist:1574898
show git branch and git status in command prompt of your current working directory
#
# Git branch/status monitor on Linux/MacOs Shel
# ---------------------------------------------
#To be added on .bashrc
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"

Here's all you have to do to add clustering to your node.js application.

  • save this code as cluster.js, and run cluster.js instead of server.js (or /bin/www, or whatever it's called for your project)
  • the only line you'll need to change is the last line - it needs to point to the location of your server.js file
var cluster = require('cluster');

if (cluster.isMaster) {
  // Count the machine's CPUs
 var cpuCount = require('os').cpus().length;
<VirtualHost 127.0.0.1>
ServerName processmaker
DocumentRoot /Users/erik/Web/processmaker.github/workflow/public_html
<Directory /Users/erik/Web/processmaker/workflow/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
@eriknyk
eriknyk / fib.php
Created June 16, 2015 18:07
fib.php
<?php
$n = $_GET? $_GET['n']: $argv[1];
function fib($n)
{
if ($n <= 2)
return 1;
else
return fib($n-1) + fib($n-2);
}
@eriknyk
eriknyk / snippets.cson
Last active October 20, 2015 00:04
Atom React snippets
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@eriknyk
eriknyk / add_apache_brew.md
Created June 24, 2017 03:28 — forked from vitorbritto/add_apache_brew.md
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"

and install Apache 2.2 with the event MPM, and we'll use Homebrew's OpenSSL library

@eriknyk
eriknyk / zoonavigator.docker-compose.yml
Created November 6, 2019 20:32 — forked from elkozmon/zoonavigator.docker-compose.yml
Docker compose file for ZooNavigator with Zookeeper
version: '2.1'
services:
web:
image: elkozmon/zoonavigator-web:latest
container_name: zoonavigator-web
ports:
- "8000:8000"
environment:
API_HOST: "api"
@eriknyk
eriknyk / zoonavigator.docker-compose.yml
Created November 6, 2019 20:32 — forked from elkozmon/zoonavigator.docker-compose.yml
Docker compose file for ZooNavigator with Zookeeper
version: '2.1'
services:
web:
image: elkozmon/zoonavigator-web:latest
container_name: zoonavigator-web
ports:
- "8000:8000"
environment:
API_HOST: "api"
@font-face {
font-family: "Proxima Nova";
src: url(data:font/opentype;base64,d09GRgABAAAAAEywABIAAAAAg3QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEWU5BAAAGbAAAALgAAAGJNI0oHkZGVE0AAAGUAAAAHAAAABxdnq2WR0RFRgAAByQAAAA4AAAAQgSqBTxHUE9TAAAHXAAABCIAABH0zI0AF09TLzIAAAXUAAAAVwAAAGCAz3p9Y21hcAAASvgAAAG2AAAC5lCJVL9jdnQgAAABsAAAAB4AAAAeCkcLCmZwZ20AAAHQAAABsgAAAmUjtC+nZ2FzcAAAA4QAAAAIAAAACAAAABBnbHlmAAALgAAAO4sAAF8I3FzIU2hlYWQAAAOMAAAANQAAADb9TDtqaGhlYQAABiwAAAAgAAAAJA9PBsBobXR4AABHDAAAAh8AAANsqw8hfGxvY2EAAEksAAABuAAAAbhtqYQ8bWF4cAAABkwAAAAgAAAAIAIDAhpuYW1lAAADxAAAAawAAANRLIw+gnBvc3QAAErkAAAAEwAAACD/DQAocHJlcAAABXAAAABjAAAAdNUcAaMAAAABAAAAAMmJbzEAAAAAyRrF1wAAAADK+niN/pAAAAPGBTYBYADCANABNgE+AWgBmQDkAZIBkAFYAAB42l1Ru05bQRDdDQ+TBBJjg+RoU8xmQhrvhYYCJBBXF8XIdmM5QtqNXORiXMAHUCBRg/ZrBmgoKdKmQcgFUj6BT0BiZk2iKM3Ozuycc+bMknKk6l1a73nqnARSuNOg2abfDql2FuCedH21kZF28EDzzYxeuW7ff8VgM5pyRw2gvOct5SGjaSdQi/bU/za/guE+/2Qeg0FLM01PrZOQHkJgvhm3MPie0ay7/KQvWB0uBgNDimkq7vJzKuV/S3Outgibaxm9dnAmIj+ZBmhqpY1A0186pHo+jmIJctkw1gYTU9afZCL4ZjJd1VQtM751cJfszDt
@eriknyk
eriknyk / readme.md
Last active June 19, 2021 17:19 — forked from psiborg/readme.md
Apple Magic Mouse / keyboard and Windows 10 #windows