Skip to content

Instantly share code, notes, and snippets.

View nantunes's full-sized avatar
🤔
...

Nelson Antunes nantunes

🤔
...
View GitHub Profile
@nantunes
nantunes / Activator.java
Created June 2, 2017 16:38
BundleActivator registering resources
package net.nantunes.helloword.one.internal;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.service.http.HttpContext;
import org.osgi.service.http.HttpService;
import org.osgi.service.http.NamespaceException;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
<html>
<body style="font-family: sans-serif;">
<h1 style="text-align: center">Drag the bookmarklet to your bookmarks bar</h1>
<p style="text-align: center">
<a
href="javascript:(function(){$('.blob-code%20span.blob-code-inner').parents('tr').not($('.blob-code%20span.blob-code-inner>span.pl-c').parents('tr')).toggle();})();"
style="border: solid grey 2px; border-radius: 13px; padding: 5px; background-color: lightgray; font-weight: bold; text-decoration: none;">
📖 Toggle only comments
</a>
@nantunes
nantunes / requirejs.logger.js
Last active December 14, 2015 16:53
Intercept requirejs calls and output info to console
var req_original = {
completeLoad: require.s.contexts._.completeLoad,
load: require.s.contexts._.load,
execCb: require.s.contexts._.execCb
};
require.s.contexts._.completeLoad = _completeLoad.bind(require.s.contexts._);
require.s.contexts._.load = _load.bind(require.s.contexts._);
require.s.contexts._.execCb = _execCb.bind(require.s.contexts._);
@nantunes
nantunes / README.md
Last active August 29, 2015 14:16 — forked from jxson/README.md

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

#!/bin/sh
# Ask for the administrator password upfront
sudo -v
###############################################################################
# General UI/UX
###############################################################################
echo ""
### Keybase proof
I hereby claim:
* I am nantunes on github.
* I am nantunes (https://keybase.io/nantunes) on keybase.
* I have a public key whose fingerprint is 675B 4D22 0B32 56C8 9179 1C56 9FC3 8C42 19B9 AA03
To claim this, I am signing this object: