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 / Toast para angular.md
Last active July 26, 2016 19:14
toast para angular
@phipex
phipex / Modal para angular.md
Last active July 26, 2016 19:14
modal para angular
@phipex
phipex / .gitignore
Created August 22, 2016 15:17
gitignore para proyecto eclipse java ee con maven
####### source https://github.com/github/gitignore
############### eclipse conf
.metadata
bin/
tmp/
*.tmp
*.bak
@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 / FriosCalientes.java
Last active January 26, 2018 20:49
Determina los numeros calientes y los numeros frios
final Map<Integer, Integer> integerIntegerMap = main.getFrecuencyOrderMap(lnumeros);
List<Integer> hot = main.hot(cantidad, integerIntegerMap);
System.out.println(hot);
List<Integer> cold = main.cold(cantidad, integerIntegerMap);
System.out.println(cold);
@phipex
phipex / UserService.java
Created February 3, 2018 21:21
jhipster: create user from user managment #jhipster
//public User createUser(UserDTO userDTO) {
public User createUser(ManagedUserVM userDTO) {
User user = new User();
user.setLogin(userDTO.getLogin());
user.setFirstName(userDTO.getFirstName());
user.setLastName(userDTO.getLastName());
user.setEmail(userDTO.getEmail());
user.setImageUrl(userDTO.getImageUrl());
if (userDTO.getLangKey() == null) {
user.setLangKey(Constants.DEFAULT_LANGUAGE); // default language
@phipex
phipex / AuthoritiesConstants
Created February 3, 2018 22:09
jhipster: Create new role (authoritie) #jhipster
public static final String COMERCIAL = "ROLE_EMPLOYEE";