Skip to content

Instantly share code, notes, and snippets.

Jonathan Welzel jnwelzel

Block or report user

Report or block jnwelzel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
// 2MB
if (picture.length > 2 * 1024 * 1024) {
throw new FDNFileTooLargeException("2MB.");
jnwelzel /
Created Feb 27, 2014

#First "cd" to the top directory you want to start in. (Don't be stupid and run this from your root....)

To get a confirmation for every file use: find . -type f -name "*.bak" -exec rm -i {} \;

Or if you're feeling confident use: find . -type f -name "*.bak" -exec rm -f {} \;

jnwelzel /
Created Mar 7, 2014
Workaround for starting Derby network server under JDK 7_u51 and its new security policies
  1. Grab the policy file here
  2. Use the following command $ java -Dderby.install.url=file:/home/jwelzel/apps/db-derby- -cp "lib/*" org.apache.derby.drda.NetworkServerControl start
processArtifact() {
import org.scribe.builder.api.DefaultApi10a;
import org.scribe.model.OAuthConstants;
import org.scribe.model.OAuthRequest;
import org.scribe.model.Verb;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class OAuthRequestValidator {
jnwelzel / backbone_mixin.js
Created Jun 6, 2014
Backbone mixin for enabling Reactjs components to respond to Backbone objects/collections changes
View backbone_mixin.js
// An example generic Mixin that you can add to any component that should react
// to changes in a Backbone component. The use cases we've identified thus far
// are for Collections -- since they trigger a change event whenever any of
// their constituent items are changed there's no need to reconcile for regular
// models. One caveat: this relies on getBackboneModels() to always return the
// same model instances throughout the lifecycle of the component. If you're
// using this mixin correctly (it should be near the top of your component
// hierarchy) this should not be an issue.
var BackboneMixin = {
componentDidMount: function() {
# Description:
# this script restores couchbase & neo4j from the UX reference server, e.g qa1b.
# the process for restoring this is as follows:
# - start Couchbase and stop neo4j (with
# - download the latest backup from
# - run this script as "sudo <DB_ARCHIVE_ZIP> [<CLOUDPASS_HOME_DIR>]"
# - start neo4 (with
# - hit localhost:7474/browser and confirm that DB size is apprx 32gb by clicking the circles in the top-left corner
View error.txt
[26 Feb 2015;12:30:47.562] - [WARN ] [UserServiceInterfaceImpl:1074] - Failed to associateUser java.lang.NullPointerException: null
at com.totvslabs.idm.rmi.service.impl.UserServiceInterfaceImpl.associateUserInternal(
at com.totvslabs.idm.rmi.service.impl.UserServiceInterfaceImpl.associateUser(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
View websocket-server.js
* Using
var WebSocketServer = require('ws').Server,
wss = new WebSocketServer({port: 8080});
wss.on('connection', function(ws) {
ws.on('message', function(message) {
jnwelzel / conhecimento_transporte.rb
Created Jul 23, 2012
Super classe usada no projeto CT-e para definir um objeto que possa ser tanto persistido como serializado para XML
View conhecimento_transporte.rb
# encoding: utf-8
class EntidadeCte
include Mongoid::Document
include ROXML
class << self
# apelida o xml_accessor do ROXML para cte_attr
# alias :cte_attr :xml_accessor
You can’t perform that action at this time.