This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rev-list 59848ab..develop --ancestry-path | grep -f <(git rev-list 59848ab..develop --first-parent) | tail -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl 'http://powietrze.gios.gov.pl/pjp/current/getAQIDetails' --data 'id=778¶m=AQI' --compressed | pretty-json | colorize | |
Display JSON data from sample station measuring air pollution in poland. | |
Main website: http://powietrze.gios.gov.pl/pjp/current, http://powietrze.gios.gov.pl/pjp/maps/measuringstation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new ReactiveNetwork().observeWifiSignalLevel(context) | |
.subscribeOn(Schedulers.io()) | |
... // anything else what you can do with RxJava | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Action1<WifiSignalLevel>() { | |
@Override public void call(WifiSignalLevel signalLevel) { | |
// do something with signalLevel | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new ReactiveNetwork().observeWifiSignalLevel(context, numLevels) | |
.subscribeOn(Schedulers.io()) | |
... // anything else what you can do with RxJava | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribe(new Action1<Integer>() { | |
@Override public void call(Integer level) { | |
// do something with level | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git remote rename origin old | |
$ git remote add origin ssh://[email protected]:7999/repo/repo.git | |
$ git remote remove old | |
$ git remote -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if which programname >/dev/null; then | |
echo program exists | |
else | |
echo program does not exist | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App | |
{ | |
private static final String JDBC_DRIVER = "org.sqlite.JDBC"; | |
private static final String CONNECTION_STRING = "jdbc:sqlite:/tmp/testdb.db"; | |
public static void main( String[] args ) throws SQLException, ClassNotFoundException { | |
SQLiteDataSource ds = new SQLiteDataSource(); | |
ds.setUrl("jdbc:sqlite:/tmp/data.db"); | |
DBI dbi = new DBI(ds); | |
Handle h = dbi.open(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This code is an example for a tutorial on Ubuntu Unity/Gnome AppIndicators: | |
# http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html | |
import os | |
import signal | |
import json | |
from urllib2 import Request, urlopen, URLError | |
from gi.repository import Gtk as gtk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#all in one manual fix for Ubuntu 14.04 with zsh-5.0.2 (based on mchelen's one-liner): | |
# get zsh tar file and uncompress its Doc folder to /usr/share/man/man1 | |
wget -qO- "http://downloads.sourceforge.net/project/zsh/zsh/5.0.2/zsh-5.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fzsh%2Ffiles%2Fzsh%2F5.0.2%2F&ts=1407408881&use_mirror=superb-dca3" | sudo tar xvz -C /usr/share/man/man1/ --wildcards "zsh-5.0.2/Doc/*.1" --strip-components=2 | |
# fix permissions | |
sudo chown root:root /usr/share/man/man1/zsh*.1 | |
sudo chmod 0644 /usr/share/man/man1/zsh*.1 | |
# gzip the new zsh man pages (all others are gzipped as well) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
tput civis -- invisible && telnet towel.blinkenlights.nl 23 |