Skip to content

Instantly share code, notes, and snippets.

View bsorrentino's full-sized avatar
💭
passion is fuel for life

bsorrentino bsorrentino

💭
passion is fuel for life
View GitHub Profile
import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}
@bsorrentino
bsorrentino / mvnpurgedeps.sh
Last active April 24, 2019 21:10
Remove all artifacts related to a maven project
clear
echo -n "clear project's targets"
mvn -o clean
echo -n "delete project's artifacts from local repo [y/N]"
read -n 1 del
#echo "$del"
if [ "$del" == "y" ] ; then
echo -e "\nperform delete "
@bsorrentino
bsorrentino / Rx.java
Created July 1, 2016 05:26 — forked from bduisenov/Rx.java
gwt jsinterop for Rx.js
import jsinterop.annotations.JsFunction;
import jsinterop.annotations.JsMethod;
import jsinterop.annotations.JsType;
/**
* Created by bduisenov on 15/12/15.
*/
public class Rx {
@FunctionalInterface
@bsorrentino
bsorrentino / cordova-plugin-guide.md
Last active January 29, 2025 14:11 — forked from mlynch/cordova-plugin-guide.md
Cordova Plugin Developer Guide

Cordova Plugin Development Guide for Android

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

This simple guide, walks through the what, when, why, and how of Cordova plugin development for Android.

Introduction

Before start, understand their

@bsorrentino
bsorrentino / svn-ignore-eclipse-settings.sh
Created December 16, 2016 09:41
svn commands to force ignore eclipse settings files
svn update
rm -rf /tmp/.settings
cp .classpath /tmp
cp .project /tmp
cp -R .settings /tmp
rm -rf /tmp/.settings/.svn
svn del .classpath
@bsorrentino
bsorrentino / unifiedpush-node-sender.d.ts
Created January 15, 2017 20:41
Aerogear unifiedpush node sender typescript definition
declare namespace AeroGear {
export namespace Sender {
export interface Config {
url:string,
applicationId:string,
masterSecret:string,
headers?:Object
@bsorrentino
bsorrentino / appify.sh
Last active March 31, 2022 12:43 — forked from advorak/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF
appify v3.0.0 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
Note that you cannot rename appified apps. If you want to give your app
a custom name, use the second argument:
`basename "$0"` my-script.sh "My App"
@bsorrentino
bsorrentino / preferences.d.ts
Created January 17, 2017 11:36
Preferences typescript definition
declare module "preferences" {
interface PreferencesStatic {
new<T>( identifier:string, data: T ): T;
}
var Preferences:PreferencesStatic;
export = Preferences;
}
@bsorrentino
bsorrentino / rxjs-patching.js
Created January 21, 2017 07:52 — forked from ericelliott/rxjs-patching.js
Reduce bundle size with RxJS patching
import { Observable } from 'rxjs/Observable';
// then patch import only needed operators:
import 'rxjs/add/operator/map';
import 'rxjs/add/observable/from';
const foo = Observable.from([1, 2, 3]);
foo.map(x => x * 2).subscribe(n => console.log(n));
@bsorrentino
bsorrentino / script.js
Last active March 17, 2017 09:48
Weird2JSON
function WEIRDtoJSON( weirdProtocol ) {
var pattern = /\#\$\*\sSBR_DEALERGROUP_TARGET\.TARGET(\d+)\slookup\s\*%\d+%([\w\d]+%)/g
var res = weirdProtocol.replace( pattern, "$2" );
var token = res.split('%');
var result = []; var i=0;
while( i < token.length-1 ) {
result.push( {
TYPE:token[i++],