Skip to content

Instantly share code, notes, and snippets.

@mbialon
mbialon / xxxx
Created June 7, 2023 09:23
hello
lorem ipsum

Keybase proof

I hereby claim:

  • I am mbialon on github.
  • I am mbialon (https://keybase.io/mbialon) on keybase.
  • I have a public key ASAdNZ11LlmT8xsensmdPmm1wvrQzT9cvjIXIKczsp8Lqwo

To claim this, I am signing this object:

@mbialon
mbialon / csharp.gitignore
Created April 8, 2011 08:23
C# gitignore
*.suo
*.user
obj
bin
@mbialon
mbialon / changed_files.sh
Created April 7, 2011 23:13
Print files changed in all commits except the first one.
#!/bin/bash
first_rev=`git rev-list HEAD|tail -1`
git rev-list HEAD|grep -v $first_rev|xargs git show --pretty="format:" --name-only|sort|uniq
"Co się martwisz? Co się smucisz?
Ze wsi jesteś, na wieś wrócisz."
@mbialon
mbialon / kill_by_name.sh
Created April 3, 2010 12:48
Jak zabić proces po opisie w systemie *nix
kill `ps aux|grep tomcat|grep -v grep|awk '{ print $2 }'`
@mbialon
mbialon / DelegateInvocationHandler.java
Created April 3, 2010 12:40
Tworzenie obiektów klas, które zależą od siebie nawzajem
class DelegateInvocationHandler implements InvocationHandler {
private Object delegate;
public void setDelegate(Object delegate) {
this.delegate = delegate;
}
public Object invoke(Object target, Method method, Object[] args)
throws Throwable {
return method.invoke(delegate, args);
@mbialon
mbialon / Client.java
Created April 3, 2010 12:33
Implementacja mechanizmu wtyczek za pomocą ServiceLoader
class Client {
public static void main(String[] args) {
ServiceLoader<ReportGenerator> providers = ServiceLoader.load(ReportGenerator.class);
List<String> availableFormats = new ArrayList<String>();
for (ReportGenerator generator : providers) {
availableFormats.add(generator.format());
}
// user can select format from available options
@mbialon
mbialon / c1.jsp
Created April 3, 2010 12:26
Kontekst w tagach JSP 2.0
<jsp:doBody var="theBody" />
<% String bc = (String) pageContext.getAttribute("theBody"); %>
<%= bc.toUpperCase() %>
@mbialon
mbialon / Language.java
Created March 26, 2010 08:40
Własne typy zamiast prymitywów
class Language {
private String languageCode;
}