Empátia
- https://www.youtube.com/watch?v=1oCeJGYAjWo
- https://www.youtube.com/watch?v=1Evwgu369Jw
- https://index.hu/tudomany/til/2016/01/30/mao_kinai_csodaszer
Intézményrendszer
// 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 { |
#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 |
// http://speakingjs.com/es5/ch17.html#code_copyOwnPropertiesFrom | |
// To create an identical copy of an object, you need to get two things right: | |
// - The copy must have the same prototype as the original. | |
// - The copy must have the same properties, with the same attributes as the original. | |
function copyObject(orig, deep) { | |
// 1. copy has same prototype as orig | |
var copy = Object.create(Object.getPrototypeOf(orig)); |
// 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: | |
*/ |
// under Google Chrome 36 | |
Object.prototype.toString.call([]) | |
// "[object Array]" | |
Object.prototype.toString.call(function(){}) | |
// "[object Function]" | |
Object.prototype.toString.call({}) | |
// "[object Object]" | |
Object.prototype.toString.call(null) | |
// "[object Null]" |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Startup Name Generator', |
// How to return boolean value in a cordova android plugin | |
public class ExampleClass extends CordovaPlugin { | |
@Override | |
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException { | |
if (action.equals("test")) { | |
try { | |
boolean result = testAction(); | |
callbackContext.sendPluginResult(new PluginResult(Status.OK, result)); | |
} catch (Exception e) {} |
// 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 { |
# Test Build (armv7 only) | |
# | |
ionic platform remove ios | |
gulp useref | |
ionic platform add ios | |
cp assets/build/ios/build.xcconfig platforms/ios/cordova/build.xcconfig | |
ionic build ios --device | |
xcrun -sdk iphoneos PackageApplication -v platforms/ios/build/device/appname.app -o deployments/appname-test.ipa | |
/usr/bin/codesign --display platforms/ios/build/device/appname.app | |
/usr/bin/codesign --verify platforms/ios/build/device/appname.app |