Skip to content

Instantly share code, notes, and snippets.

@phipex
phipex / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/* Bootstrap's Media Queries */
/* Large desktop */
@media (min-width: 1200px) { ... }
@media (max-width: 1199px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }
/* Landscape phone to portrait tablet */

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@phipex
phipex / node-and-npm-in-30-seconds.sh
Created September 18, 2017 20:47 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@phipex
phipex / tutorialDockerCentos7.md
Created April 12, 2018 00:48 — forked from edgardo001/tutorialDockerCentos7.md
Tutorial realizado con Docker en Centos 7

Instalar docker en centos 7

$> sudo yum update -y
$> sudo yum install docker
$> sudo systemctl start docker

para que este disponible cuando se inicia la maquina

$> sudo systemctl enable docker
@phipex
phipex / saltstack.sh
Created June 8, 2018 21:48 — forked from michaelkarrer81/saltstack.sh
[Saltstack Cheat Sheet] #saltstack
# ============
# COMMON TASKS
# ============
# Update Online Tools
salt -G "minion_roles:ONLINE" cmd.run 'cd /opt/online/online_tools;git pull'
salt -G "minion_roles:BACKUP" cmd.run 'cd /opt/online/online_tools;git pull'
# Check Release Tag of Online Core
salt -G "minion_roles:ONLINE" cmd.run 'git -C /opt/online/online_o8r166 describe --tags --exact-match --match o8r*'

Start Kafka service

The following commands will start a container with Kafka and Zookeeper running on mapped ports 2181 (Zookeeper) and 9092 (Kafka).

docker pull spotify/kafka
docker run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=kafka --env ADVERTISED_PORT=9092 --name kafka spotify/kafka

Why Spotify?

ADVERTISTED_HOST was set to kafka, which will allow other containers to be able to run Producers and Consumers.

<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is based on the javascript.lang file of GtkSourceView.
It has additional Typescript keywords defined.
Author: Johannes Bergmann
Copyright (C) 2014 Johannes Bergmann
###
@phipex
phipex / git-branch-simplify.md
Created August 9, 2018 22:17 — forked from datagrok/git-branch-simplify.md
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@phipex
phipex / proxy.js
Created July 8, 2020 22:05 — forked from beradrian/proxy.js
CORS proxy with node-http-proxy
/** If you want to use the local development environment with the dev backend,
* this will create a proxy so you won't run into CORS issues.
* It accepts the following command line parameters:
* - port the port where the proxy will listen
* - target the DEV backend target to contact.
* Example: If you set the port to 3000 and target to https://dev.nibo.ai then
* your actual "resourceBaseUrl" in NiboSettings should be http://localhost:3000/api/v1
*/
// Define the command line options
const optionDefinitions = [