See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
<template> | |
<div class="container"> | |
<div class="col-sm-8"> | |
<h3><button id='upload-btn' class="btn btn-secondary btn-xs" @click="onClick()">Upload</button></h3> | |
<h3>Preview</h3> | |
<div class="canvas-containter" id="preview-container"> | |
<!-- <canvas id="preview-pica" class="img-responsive" style="max-width: 300px;"></canvas> --> | |
<img v-if="previewImage" :src="previewImage" style="max-width: 300px;"> | |
</div> |
static var httpClient = new HttpClient(); | |
Future<File> _downloadFile(String url, String filename) async { | |
var request = await httpClient.getUrl(Uri.parse(url)); | |
var response = await request.close(); | |
var bytes = await consolidateHttpClientResponseBytes(response); | |
String dir = (await getApplicationDocumentsDirectory()).path; | |
File file = new File('$dir/$filename'); | |
await file.writeAsBytes(bytes); | |
return file; | |
} |
import 'package:flutter/material.dart'; | |
void main() => runApp(new MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Flutter Demo', | |
theme: new ThemeData( |
Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params
when you had a long URI with multiple parameters and nested routes.
Let's say you're building routes for a website www.music.com
. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.
At our application level, we could first have a Router to handle any requests to our albums.
const express = require('express');
.table.table-ellipsis tbody td { | |
max-width: 100px; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
white-space: nowrap | |
} |
Put this on your wp-config.php
/* That's all, stop editing! Happy blogging. */
define('FS_METHOD', 'direct');
// node.js : Mailgun via API | |
var request = require('request') | |
var apiBaseUrl = 'https://api.mailgun.net/v3/sandboxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.mailgun.org'; | |
var apiKey = 'key-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; | |
var from = 'Excited User'; | |
var to = 'example@example.com'; | |
var subject = 'Hello'; | |
var text = 'Testing some Mailgun awesomness!'; |
// DEPS: npm install jsts@0.17.0 | |
// USAGE: node remove_holes.js holey_coverage.geojson solid_coverage.geojson | |
var fs = require('fs'); | |
var jsts = require("jsts"); | |
var parser = new jsts.io.GeoJSONParser(); | |
var geojson = JSON.parse(fs.readFileSync(process.argv[2], 'utf8')); | |
var removedHoles = 0; |