Skip to content

Instantly share code, notes, and snippets.

View matthewbednarski's full-sized avatar

Matthew Bednarski matthewbednarski

  • Barbarano Vicentino (VI), Italy
View GitHub Profile
<sap.ui.core:FragmentDefinition
xmlns:sap.ui.core="sap.ui.core"
xmlns:sap.m="sap.m"
xmlns:sap.ui.layout.form="sap.ui.layout.form"
xmlns:sap.ui.core.mvc="sap.ui.core.mvc" >
<sap.m:Panel headerText="dfdff" expandable="true" expanded="true">
<sap.m:customData>
<sap.ui.core:CustomData key="sap-ui-fastnavgroup" value="true" writeToDom="true"></sap.ui.core:CustomData>
</sap.m:customData>
<sap.m:content>
return (function(q, _, context) {
debugger;
var defer = q.defer();
sap.ui.require(["aicomp/domain/element/api", "aicomp/service/noty"], function(
api,
noty
) {
var current = api.current();
var flatcodes = flattenAndGroup(current);
api.model().setProperty("/flat_codes_start", shallowclone(flatcodes));
@matthewbednarski
matthewbednarski / test
Created December 14, 2016 08:27
Hello!
Welcome to StackEdit!
===================
Hey! I'm your first Markdown document in **StackEdit**[^stackedit]. Don't delete me, I'm very helpful! I can be recovered anyway in the **Utils** tab of the <i class="icon-cog"></i> **Settings** dialog.
----------
Documents
/***
*
* Extends jQuery with dropbox crud functionality
*
* All API methods return a promise unless specified otherwise.
*
*/
(function($) {
jQuery.extend({
dropboxAuth: new DropboxAuth(),
@matthewbednarski
matthewbednarski / jquery.ajax.blob.js
Created October 23, 2015 03:28
Exents $.ajax to return binary formats without string serialization
(function($) {
/**
* http://artandlogic.com/2013/11/jquery-ajax-blobs-and-array-buffers/
*
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2
* within the comfortable framework of the jquery ajax request, with full support for promises.
*
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that
@matthewbednarski
matthewbednarski / spinner-directive.js
Last active October 2, 2015 14:29
a spinner directive using bootstrap modal and font-awesome fonts
(function() {
var app = angular.module('mcbSpin', [])
.directive('spinner', [Spinner]);
function Spinner() {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
replace: true,
scope: {
show: '@',
@matthewbednarski
matthewbednarski / manifest-create
Created October 2, 2015 11:22
Create a manifest.appcache for a given html file
#!/bin/bash
SWITCH="\e["
NRM="${SWITCH}0m" YLW="${SWITCH}33m" RED="${SWITCH}31m"
GRN="${SWITCH}32m"
BLU="${SWITCH}34m"
dir=$(dirname "${BASH_SOURCE[0]}")
function error {
echo -e $RED$@$NRM
@matthewbednarski
matthewbednarski / focus-directive.js
Created October 1, 2015 14:21
An angular directive/service for giving focus to elements with a tabIndex
(function() {
var app = angular.module('mcbFocus', [])
.directive('focusOn', function() {
return function(scope, elem, attr) {
if(attr.tabIndex === undefined){
elem.attr('tabindex', -1);
}
scope.$on('focusOn', function(e, name) {
if (name === attr.focusOn) {
elem[0].focus();
@matthewbednarski
matthewbednarski / datepicker-directive.js
Created October 1, 2015 14:21
A bootstrap-datepicker angular directive
(function() {
var app = angular.module("siDate", [])
.directive('datePicker', [datePicker]);
function datePicker() {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
replace: true,
scope: {
@matthewbednarski
matthewbednarski / datepicker-directive.js
Created October 1, 2015 14:20
A bootstrap-datepicker angular directive
(function($) {
var app = angular.module("siDate", [])
.directive('datePicker', [datePicker]);
function datePicker() {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
replace: true,
scope: {