curl -X POST "http://192.168.0.100/YamahaRemoteControl/ctrl" \
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/** | |
* @website http://albulescu.ro | |
* @author Cosmin Albulescu <cosmin@albulescu.ro> | |
*/ | |
import ( | |
"bytes" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function distance(lon1, lat1, lon2, lat2) { | |
const R = 6371e3; // metres | |
const Q1 = lat1 * Math.PI / 180; | |
const Q2 = lat2 * Math.PI / 180; | |
const DP = (lat2 - lat1) * Math.PI / 180; | |
const DA = (lon2 - lon1) * Math.PI / 180; | |
const a = Math.sin(DP / 2) * Math.sin(DP / 2) + | |
Math.cos(Q1) * Math.cos(Q2) * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This gist aims to explain how it's possible that async functions inside React | |
// using createFetcher(Promise).next(key) can work. | |
// A possible implementation of the new createFetcher function | |
// as shown by https://twitter.com/jamiebuilds/status/969169357094842368 | |
// @param method, should be a function returning a Promise. | |
// @returns an object with a property 'read', used to read values from the resolved 'cache'. | |
const createFetcher = function(method) { | |
// First create a Map for the resolved values. | |
const resolved = new Map() |
I. You're stick to the "normal" way of Meteor development and you can't work how you want without installing a package that do some job. That also might be no problem because packages do more than what you want and this increase filesize and this will increase the loading time of the app.
II. Its hard to debug, when there are problems. Its very hard to investigate and find a solution and this increase development time
III. The current app is bound to unnecessary external services like
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventBusBind | |
@Component({ | |
selector: 'wpci-header', | |
templateUrl: './header.component.html', | |
styleUrls: ['./header.component.less'] | |
}) | |
export class HeaderComponent implements OnInit { | |
ngOnInit() {} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function LocalStorageProperty(property:string) { | |
return function(target: any, propertyKey: string | symbol) { | |
var _ref_ = window['Reflect']; | |
var meta, type; | |
if(_ref_.getMetadata) { | |
meta = _ref_.getMetadata('design:type', target, propertyKey); | |
var result = /^function\s+([\w\$]+)\s*\(/.exec( meta.toString() ) | |
var fnName = result ? result[ 1 ] : ''; | |
if(fnName && fnName.length) { |
NewerOlder