Skip to content

Instantly share code, notes, and snippets.

Matthew Bednarski matthewbednarski

View GitHub Profile
View test.ui.xml
<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>
View test.controller.js
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));
View test
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
View jquery.dropbox.js
/***
*
* 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 Oct 23, 2015
Exents $.ajax to return binary formats without string serialization
View jquery.ajax.blob.js
(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 Oct 2, 2015
a spinner directive using bootstrap modal and font-awesome fonts
View spinner-directive.js
(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 Oct 2, 2015
Create a manifest.appcache for a given html file
View manifest-create
#!/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 Oct 1, 2015
An angular directive/service for giving focus to elements with a tabIndex
View focus-directive.js
(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 Oct 1, 2015
A bootstrap-datepicker angular directive
View datepicker-directive.js
(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 Oct 1, 2015
A bootstrap-datepicker angular directive
View datepicker-directive.js
(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: {
You can’t perform that action at this time.