Confira o post dessa pen no CodePen.
By Larissa Surano. License.
| @Component({ | |
| selector: 'add-story-form', | |
| template: ` | |
| <div class="container"> | |
| <h1>New Story</h1> | |
| <form [formGroup]="newStory" | |
| (submit)="submit($event)" | |
| (success)="onSuccess()" | |
| (error)="onError($event)" | |
| connectForm="newStory"> | 
| Install http://download-us.sourcegear.com/DiffMerge/4.2.0/DiffMerge_4.2.0.697.stable_x64.msi | |
| // this is an adaptation of http://adventuresincoding.com/2010/04/how-to-setup-git-to-use-diffmerge | |
| Then run the following commands from the git bash | |
| git config --global merge.tool diffmerge | |
| git config --global mergetool.diffmerge.cmd "sgdm --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE" | 
| /* | |
| * Module dependencies. | |
| */ | |
| var express = require('express') | |
| , routes = require('./routes') | |
| , user = require('./routes/user') | |
| , common = require('./routes/common') | |
| , fs = require('fs') | |
| , http = require('http') | |
| , util = require('util') | 
| var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
| // In middleware | |
| app.use(function (req, res, next) { | |
| // action after response | |
| var afterResponse = function() { | |
| logger.info({req: req}, "End request"); | |
| // any other clean ups | 
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Web Components</title> | |
| <style> | |
| body { | |
| font-family: 'Helvetica Neue'; | |
| } | |
| </style> | 
Confira o post dessa pen no CodePen.
By Larissa Surano. License.
| server { | |
| # Listen on port 81 | |
| listen 81; | |
| # Server name being used (exact name, wildcards or regular expression) | |
| # server_name phpmyadmin.my; | |
| root /usr/share/phpmyadmin; | 
| // Other sources: http://swiftdeveloperblog.com/send-http-post-request-example-using-swift-and-php/ | |
| // Create request | |
| let baseUrl = "http://www.ocrwebservice.com/restservices/processDocument", | |
| params = "?language=english&gettext=true&outputformat=txt", | |
| requestUrl = NSURL(string: "\(baseUrl)\(params)"), | |
| request = NSMutableURLRequest(URL:requestUrl!) | |
| request.HTTPMethod = "POST"; | |
| request.HTTPBodyStream = NSInputStream(fileAtPath: "[/YOUR/FILE/PATH/IMAGE.jpg]") | |
| import Foundation | |
| let config = NSURLSessionConfiguration.defaultSessionConfiguration() | |
| let userPasswordString = "[email protected]:password" | |
| let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding) | |
| let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil) | |
| let authString = "Basic \(base64EncodedCredential)" | |
| config.HTTPAdditionalHeaders = ["Authorization" : authString] | |
| let session = NSURLSession(configuration: config) | 
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |