Skip to content

Instantly share code, notes, and snippets.

View danielestevez's full-sized avatar
🍁
playing with something, probably

Daniel Estévez danielestevez

🍁
playing with something, probably
View GitHub Profile
@danielestevez
danielestevez / gist:1391076
Created November 24, 2011 10:46
GIT Configurations: Alias to Push/Pull automatically on working branch, nice git log format #git
#include this in your .gitconfigure to perform a pull/push origin on the branch you are currently working
# avoids mistakes performing 'pull origin master' when you are in stable and so on
#
[alias]
# Pushes/pulls to/from remote branch with corresponding name
pl = !git pull origin $(git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,')
ps = !git push origin $(git symbolic-ref HEAD | sed -e 's,.*/\\(.*\\),\\1,')
@danielestevez
danielestevez / gist:2044589
Last active April 10, 2024 07:51
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@danielestevez
danielestevez / gist:2215636
Created March 27, 2012 13:09
Useful aliases for bash (bash_aliases)
# .bash_aliases
alias mvi='mvn clean install -Dtest.suite=none -Dit.suite=none -o -fae'
alias psg='ps -ef | grep $1'
alias sk='sudo kill -9 $1'
alias sshi='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
@danielestevez
danielestevez / newgitsubmodulesbranch
Created July 23, 2012 07:48
Create brnaches and push to remote for all GIT submodules
function newbranch() {
git submodule foreach git checkout ${1}
git submodule foreach git pull origin ${1}
git submodule foreach git co -b ${2}
git submodule foreach git push origin ${2}
git status
}
# newbranch master newbranchname
@danielestevez
danielestevez / ConstraintTrigger
Created October 15, 2014 09:05
Complex SQL Constraints as a Trigger
CREATE TRIGGER complex_constraint BEFORE INSERT ON my_table
FOR EACH ROW
BEGIN
IF /*complex constraint*/(NEW.field1 IS NOT NULL AND NEW.field2 IS NOT NULL) OR (NEW.field1 IS NULL AND NEW.field2 IS NULL) THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'complex constraint exception message';
END IF;
END
@danielestevez
danielestevez / printXML
Created February 24, 2015 11:29
Print an org.w3c.dom.Document in console
private static void printXML(final Document responseDoc) throws Exception
{
DOMSource domSource = new DOMSource(responseDoc);
StringWriter stringWriter = new StringWriter();
StreamResult streamResult = new StreamResult(stringWriter);
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer;
transformer = transformerFactory.newTransformer();
transformer.transform(domSource, streamResult);
System.out.println(stringWriter.toString());
@danielestevez
danielestevez / debugsql.sql
Last active February 22, 2018 11:51
Utils for debugging triggers and procedures in SQL
DROP TABLE IF EXISTS `kinton`.`debug_msg`;
CREATE TABLE `debug_msg` (
`msg` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
INSERT INTO debug_msg (msg) VALUES (CONCAT('message: ',IFNULL(variable, 'NULL')));
alias mvi='mvn clean install -Dtest.suite=none -Dit.suite=none -fae -T1C'
alias mvall='mvn clean install -Dtest.suite=all -Dit.suite=all -fae -T1C'
alias mvallf='mvan clean install -Dtest.suite=all -Dit.suite=all -ff -T1C'
alias mvndep='mvn cargo:deployer-redeploy'
alias psg='ps -ef | grep $1'
alias sk='sudo kill -9 $1'
alias sshi='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
#[user]
# signingkey = xxxxx
# email = contact@danielestevez.com
# name = Dani Estevez
[user]
name = daniel.estevez
@danielestevez
danielestevez / keybase.md
Created July 23, 2018 18:11
keybase verification

Keybase proof

I hereby claim:

  • I am danielestevez on github.
  • I am destevez (https://keybase.io/destevez) on keybase.
  • I have a public key whose fingerprint is D643 2F6B 354B B8A3 5A62 9875 4A38 23E7 0D46 E466

To claim this, I am signing this object: