Skip to content

Instantly share code, notes, and snippets.

@pbakondy
pbakondy / main.dart
Created January 6, 2021 14:11
Fluffer Divider thickness
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Startup Name Generator',
@pbakondy
pbakondy / httpRequest.m
Last active November 25, 2022 01:31
HTTP Request Objective-C implementations
#import <Foundation/Foundation.h>
@interface MyNetwork : NSObject
- (NSData* )httpRequestWithURL:(NSURL *)url httpMethod:(NSString *)httpMethod body:(NSData *)body contentType:(NSString *)contentType error:(NSError **)error;
@end
@implementation MyNetwork
@pbakondy
pbakondy / umd.js
Created January 18, 2016 12:34
UMD wrapper
// https://toddmotto.com/what-function-window-document-undefined-iife-really-means/
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.MYMODULE = factory();
}
})(this, function () {
http://www.slideshare.net/skabber/provisioning-profiles-like-a-pro
http://www.slideshare.net/skabber/advanced-app-building
https://possiblemobile.com/2013/04/what-is-a-provisioning-profile-part-1/
https://possiblemobile.com/2013/04/what-is-a-provisioning-profile-part-2/
@pbakondy
pbakondy / cordova-android-install.sh
Created November 18, 2015 11:55
Install Cordova Android dependencies on OSX
# ionic build Android | error: No installed build tools found. Please install the Android build tools
# http://stackoverflow.com/questions/31190355/ionic-build-android-error-no-installed-build-tools-found-please-install-the
# http://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html
#
# Install SDK Packages
# - Android 5.1.1 (API 22) platform SDK
# - Android SDK Build-tools version 19.1.0 or higher
# - Android Support Repository (Extras)
@pbakondy
pbakondy / getURLParamValue.js
Last active September 3, 2015 16:22
Return document URL GET parameter value by name
function getURLParamValue(name) {
var v;
document.location.search.substring(1).split('&').forEach(function(value) {
if (value.split('=')[0] === name) {
v = value.split('=')[1];
}
});
return v;
}
@pbakondy
pbakondy / essential-javascript-functions.js
Created July 20, 2015 16:00
7 Essential JavaScript Functions
// http://davidwalsh.name/essential-javascript-functions
/*
debounce
The debounce function can be a game-changer when it comes to event-fueled performance.
If you aren't using a debouncing function with a scroll, resize, key* event, you're
probably doing it wrong. Here's a debounce function to keep your code efficient:
*/
@pbakondy
pbakondy / isNotificationEnabled.java
Created July 20, 2015 10:01
Cordova - Push Notifications - Android - How to check notifications are disabled for the application?
// Cordova - Push Notifications - Android
// How to check notifications are disabled for the application?
// Works on Andoid 4.4+ (KitKat)
// Otherwise returns 'true'
// original:
// http://stackoverflow.com/questions/11649151/
public class NotificationsUtils {
@pbakondy
pbakondy / parse-json.js
Created July 6, 2015 10:25
Parse JSON, strip BOM
// https://github.com/npm/npm/blob/master/lib/utils/parse-json.js
'use strict'
var parseJSON = module.exports = function (content) {
return JSON.parse(stripBOM(content))
}
parseJSON.noExceptions = function (content) {
try {