Skip to content

Instantly share code, notes, and snippets.

View massahud's full-sized avatar

Geraldo Massahud massahud

View GitHub Profile
@massahud
massahud / JerseyConfiguration.java
Last active November 3, 2017 10:09
Swagger jackson jersey springboot java
import javax.inject.Inject;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.Consumes;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.ext.Provider;
import io.swagger.converter.ModelConverters;
import io.swagger.jackson.ModelResolver;
import io.swagger.jaxrs.config.BeanConfig;
@massahud
massahud / tolocalestring.js
Created December 14, 2016 11:53
Date to locale string in javascript
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
let year = 'numeric';
let month = '2-digit';
let day = '2-digit';
let hour = '2-digit';
let minute = '2-digit';
let second = '2-digit';
let hour12 = false;
let weekday = 'short';
let era = 'narrow';
@massahud
massahud / 0_reuse_code.js
Created December 14, 2016 11:15
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

= under construction =

. git clone https://github.com/apereo/cas-overlay-template.git . copy etc/cas/config to /etc/cas/config . edit /etc/cas/config to point to your domain . mvn clean package . java -jar cas.war

@massahud
massahud / eclipselink.md
Last active October 28, 2021 13:16
Wildfly 10.1.0
@massahud
massahud / java_opts.md
Last active October 31, 2016 12:46
Profile JBoss 7 netbeans

Add to java opts:

-Djboss.modules.system.pkgs=org.netbeans.lib.profiler.server
@massahud
massahud / meteorc9.io.md
Last active September 16, 2016 12:28
Meteor c9.io

Meteor on c9.io

Inside a node.js workspace:

Install: curl https://install.meteor.com/ | sh

To start meteor: meteor --port $IP:$PORT

import java.util.Arrays;
import java.util.List;
public class RadixSort {
public static List<String> sort(List<String> strings, int maxDigits) {
List<String> sorted = strings;
for (int i = maxDigits - 1; i > 0; i--) {
sorted = countSort(sorted, i);
}
return sorted;
@massahud
massahud / Portable Node.js andNPM on windows.md
Last active March 27, 2025 20:21
Portable Node.js and NPM on windows
  1. Get node binary (node.exe) from http://nodejs.org/download/
  2. Create the folder where node will reside and move node.exe to it
  3. Download the last zip version of npm from http://nodejs.org/dist/npm
  4. Unpack the zip inside the node folder
  5. Download the last tgz version of npm from http://nodejs.org/dist/npm
  6. Open the tgz file and unpack only the file bin/npm (without extension) directly on the node folder.
  7. Add the the node folder and the packages/bin folder to PATH
  8. On a command prompt execute npm install -g npm to update npm to the latest version

Now you can use npm and node from windows cmd or from bash shell like Git Bash of msysgit.

@massahud
massahud / gist:b7fd98dfeb5bdf54c83f
Last active August 29, 2015 14:01
Remove sonar duplicated last build
update sonar.snapshots old_snap set old_snap.islast=0
where islast=1
and exists (
select * from sonar.snapshots new_snap
where new_snap.created_at > old_snap.created_at
and new_snap.project_id = old_snap.project_id
and new_snap.islast=1
);