- Fix your email address in git config
git config user.name "Your Name"
git config user.email "your@address.com"
git submodule foreach --recursive 'git config user.name "Your Name" && git config user.email "your@address.com"'
- Rebase
<?xml version="1.0" encoding="UTF-8" ?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="html"/> | |
<xsl:template match="/"> | |
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">]]></xsl:text> | |
<html> | |
<head> | |
<title> | |
Xunit Test Results - For: <xsl:value-of select="@name"/> | |
</title> |
git config user.name "Your Name"
git config user.email "your@address.com"
git submodule foreach --recursive 'git config user.name "Your Name" && git config user.email "your@address.com"'
#!/usr/bin/perl | |
use strict; | |
my $action = ''; | |
my $filename = '-'; | |
for my $arg (@ARGV){ | |
if ($arg eq "-e" or $arg eq "--export"){ | |
$action = 'export'; |
sudo apt-get install xvfb | |
sudo vim /etc/init.d/xvfb | |
sudo chown root:root /etc/init.d/xvfb | |
sudo chmod a+x /etc/init.d/xvfb | |
sudo update-rc.d xvfb defaults | |
# The Ubuntu server can now run software with a GUI in a headless mode |
Notes on AngularJS apps testing through Karma and Protractor
// Explain what the Function.prototype.bind method allows. | |
// Use properly to fix this TypeError: Illegal invocation | |
var myLog = console.log; | |
myLog("hola"); | |
=> | |
// The bind method allows us to create a new function which is permanently bound to a given value of `this` | |
var myLog = console.log.bind(console); | |
myLog("hola"); //==> "hola" | |
// As a bonus, you can't override its `this` value using call or apply. | |
myLog.call(window, "hello"); // will be ignored and will keep bound to console.log() |
;------------------------------------------------------------------------------ | |
;begin Create a new file with Ctrl+Alt+N keyboard shortcut in Windows Explorer | |
;------------------------------------------------------------------------------ | |
SetTitleMatchMode RegEx | |
; Ctrl+Alt+N to create new empty file | |
#IfWinActive ahk_class CabinetWClass ;Windows Explorer | |
^!n:: | |
ExplorerFocusFilePane() | |
Sleep 50 | |
Send {End} |
///////////////////////////////////////////////////////////// | |
// Creating a custom event listener on the document object // | |
///////////////////////////////////////////////////////////// | |
var $doc = $(document); | |
var $items = $('.items'); | |
var $log = $('.log'); | |
// DOM-related logic | |
$doc.on('addItem', function (event, value) { | |
$items.append('<li>New item ' + value + '</li>') |
module OrderService | |
def self.create(listener, user, order_attrs) | |
Order.new(order_attrs.merge(user: current_user)) | |
if order.save | |
transaction = PaymentProcessor.create_payment(order) | |
listener.order_creation_succeeded(order, transaction) | |
else | |
listener.order_creation_failed(order) | |
end | |
end |
module Decorator | |
def initialize(decorated) | |
@decorated = decorated | |
end | |
def method_missing(method, *args) | |
args.empty? ? @decorated.send(method) : @decorated.send(method, args) | |
end | |
end |