Stash current changes
- git > Stash > Stash (Include Untracked)
Create stash as patch
git stash show "stash@{0}" -p > changes.patch
Apply patch
def managePom(update=False): | |
from xml.etree import ElementTree as et | |
ns = "http://maven.apache.org/POM/4.0.0" | |
et.register_namespace('', ns) | |
tree = et.ElementTree() | |
tree.parse('pom.xml') | |
p = tree.getroot().find("{%s}version" % ns) | |
if update: | |
p.text = update | |
tree.write('pom.xml') |
#!/bin/sh | |
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz | |
tar xzf apache-maven-3.3.9-bin.tar.gz | |
mkdir /usr/local/maven | |
mv apache-maven-3.3.9/ /usr/local/maven/ | |
alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1 | |
alternatives --config mvn |
Some of you had asked, how to stay updated with changes happening in the programming world.
Here are some links which I look almost daily
Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.
The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.
Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.
Bash is the JavaScript of systems programming. Although in some cases it's better to use a systems language like C or Go, Bash is an ideal systems language for smaller POSIX-oriented or command line tasks. Here's three quick reasons why:
This document is how I write Bash and how I'd like collaborators to write Bash with me in my open source projects. It's based on a lot of experience and time collecting best practices. Most of them come from these two articles, but here integrated, slightly modified, and focusing on the most bang for buck items. Plus some ne
copy($(".checklist-item:not(.checklist-item-checked)").map(function() { | |
var e = $(this), | |
item = e.find(".checklist-item-details-text").text() | |
if (e.hasClass("checklist-item-state-complete")) { | |
item = item + " (DONE)" | |
} | |
return item | |
}).get().join("\n")) |
This is a template for creating and running a Jetty web application, using Jersey + Jackson for REST, and Weld for CDI. | |
It is organized as a maven project, which builds a WAR file deployable to a standalone Jetty server. | |
The Jetty maven plugin - which is more suitable for development time - is also configured in the pom.xml. | |
Comments: | |
* As Jetty is a servlet-3.0 compatible container, no configuration is needed in web.xml | |
* Due to a bug in maven, it's required to use version 3.2.2 or above | |
* The JaxRs API classes are to be placed at the package - or below - the one where 'RestConfig.java' is | |
* When using in standalone Jetty installation, enable the 'cdi' module before deploying | |
>> java -jar start.jar --add-to-startd=cdi |
# cheat_sheet.org.sh | |
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License. | |
# Best viewed in emacs org-mode. | |
# Alternately, one can keep this cheat sheet handy by adding the following line to ~/.bashrc: | |
# | |
# alias cheatsheet="less ~/path_to_cheat_sheet.org.sh" | |
# | |
# Originally by WilliamHackmore: https://github.com/WilliamHackmore/linuxgems | |
# This version by goodevilgenius: https://gist.github.com/goodevilgenius/2d1c01251c524610a2cd |