Skip to content

Instantly share code, notes, and snippets.

View szilard-nemeth's full-sized avatar
:octocat:

Szilard Nemeth szilard-nemeth

:octocat:
View GitHub Profile
@jioo
jioo / share-git-stash.md
Last active July 27, 2024 07:04
How to export stash as a file, and apply it to another computer

Stash current changes

  • git > Stash > Stash (Include Untracked)

Create stash as patch

git stash show "stash@{0}" -p > changes.patch

Apply patch

@dizzythinks
dizzythinks / managePom.py
Created November 10, 2017 10:48
Read a pom.xml and get version or update it in Python
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')
@miroslavtamas
miroslavtamas / install-apache-maven-3.3.9.sh
Created April 22, 2016 10:48
Install Apache Maven 3.3.9 on CentOS
#!/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
@anildigital
anildigital / stay_up_to_date_in_programming.md
Created March 17, 2016 14:02
Stay up to date in programming world
@dropmeaword
dropmeaword / browser_history.md
Last active July 19, 2024 00:09
Playing around with Chrome's history

Browser histories

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.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

progrium/bashstyle

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:

  • It's everywhere. Like JavaScript for the web, Bash is already there ready for systems programming.
  • It's neutral. Unlike Ruby, Python, JavaScript, or PHP, Bash offends equally across all communities. ;)
  • It's made to be glue. Write complex parts in C or Go (or whatever!), and glue them together with Bash.

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

@PurpleBooth
PurpleBooth / README-Template.md
Last active July 28, 2024 03:34
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@niallsmart
niallsmart / copy-checklist.js
Last active December 28, 2023 00:10
Copy Trello checklist to clipboard
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"))
@zach-m
zach-m / Jetty 9 + Weld 2 + Jersey 2 + Jackson 2 + Maven
Last active July 1, 2023 20:25
Jetty 9 + Weld 2 + Jersey 2 + Jackson 2 + Maven
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
@goodevilgenius
goodevilgenius / cheat_sheet.org.sh
Last active October 22, 2023 12:25
[Linux cheat sheet] A succinct cheat sheet for newbie linux coders and system administrators, documenting some of the more obscure and useful gems of linux lore. Intended to be viewed in emacs org-mode, or VimOrganizer, though any text editor will suffice. #Linux #Unix #POSIX #cli
# 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