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
package org.indywidualni.test; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.support.v7.app.ActionBarActivity; | |
import android.util.Log; | |
import java.net.URL; | |
import java.util.ArrayList; | |
import nl.matshofman.saxrssreader.RssFeed; | |
import nl.matshofman.saxrssreader.RssItem; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="app_name" translatable="false">fNotifier</string> | |
<string name="settings">Settings</string> | |
<string name="author" translatable="false">Krzysztof \'Koras\' Grabowski</string> | |
<string name="indywidualni" translatable="false">Indywidualni.org</string> | |
<string name="email_author">Contact me</string> | |
<string name="choose_email_client">Choose e-mail client</string> | |
<string name="google_play" translatable="false">Google Play</string> |
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
interface Email{ //( 1) | |
public String getFrom(); //( 2) | |
public String getMessage(); //( 3) | |
} //( 4) | |
// ############################################## //( 5) | |
class TextEmail implements Email{ //( 6) | |
private String from, message; //( 7) | |
public TextEmail(String from, String message){ //( 8) | |
this.from = from; //( 9) | |
this.message = message; //(10) |
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
// url decoder, recreate all the special characters | |
private static String urlDecode (String url) { | |
return url.replace("%3C", "<").replace("%3E", ">").replace("%23", "#").replace("%25", "%") | |
.replace("%7B", "{").replace("%7D", "}").replace("%7C", "|").replace("%5C", "\\") | |
.replace("%5E", "^").replace("%7E", "~").replace("%5B", "[").replace("%5D", "]") | |
.replace("%60", "`").replace("%3B", ";").replace("%2F", "/").replace("%3F", "?") | |
.replace("%3A", ":").replace("%40", "@").replace("%3D", "=").replace("%26", "&") | |
.replace("%24", "$").replace("%2B", "+").replace("%22", "\"").replace("%2C", ",") | |
.replace("%20", " "); | |
} |
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
import java.io.UnsupportedEncodingException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
public class Main { | |
public static void main(String[] args) { | |
String plain = "example"; | |
System.out.println("Plain: " + plain); | |
try { | |
System.out.println("SHA-1: " + AeSimpleSHA1.SHA1(plain)); |
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
vim /etc/nginx/nginx.conf | |
... | |
server { | |
... | |
location ^~ /.well-known/acme-challenge/ { | |
allow all; | |
default_type "text/plain"; | |
} | |
... |
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
package com.emil.android.util; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.telephony.TelephonyManager; | |
/** | |
* Check device's network connectivity and speed | |
* @author emil http://stackoverflow.com/users/220710/emil |
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
➜ ls | |
1544526681_2018_12_11_11.4.5_gitlab_backup.tar | |
➜ tar -xvf 1544526681_2018_12_11_12.2.1_gitlab_backup.tar | |
# Unpacking... | |
➜ ls | |
1544526681_2018_12_11_12.2.1_gitlab_backup.tar builds.tar.gz pages.tar.gz | |
artifacts.tar.gz db repositories | |
backup_information.yml lfs.tar.gz uploads.tar.gz | |
➜ cd repositories/example | |
➜ git clone example.wiki.bundle |
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
# See dhcpcd.conf(5) for details. | |
# Allow users of this group to interact with dhcpcd via the control socket. | |
#controlgroup wheel | |
# Inform the DHCP server of our hostname for DDNS. | |
hostname | |
# Use the hardware address of the interface for the Client ID. | |
#clientid |