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
Optional<File[]> files = Optional.ofNullable(new File(staticFolder).listFiles()); | |
return files.map(logos -> Arrays.stream(logos) | |
.filter(file -> file.getName().matches(".+(png|jpg|gif)")) | |
.findFirst() | |
.map(filename -> String.format("%s/%s/logo/%s", staticUrl, division, filename)) | |
.orElse("")) | |
.orElse(""); |
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
Optional<File[]> files = Optional.ofNullable(new File(staticFolder).listFiles()); | |
return files.map(logos -> Arrays.stream(logos) | |
.filter(file -> file.getName().matches(".+(png|jpg|gif)")) | |
.findFirst() | |
.map(filename -> String.format("%s/%s/logo/%s", staticUrl, division, filename)) | |
.orElse("")) | |
.orElse(""); |
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 main | |
import ( | |
"bufio" | |
"fmt" | |
"net/http" | |
"os" | |
) | |
const APIURL = "https://api.telegram.org/bot" |
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
func store(text string, c redis.Conn) { | |
text = strings.ToLower(text) | |
splitted := strings.Split(text, " ") | |
fmt.Println(len(splitted)) | |
for k, v := range splitted { | |
if k < len(splitted) { | |
fmt.Printf("%s -> %s\n", splitted[k], splitted[k+1]) | |
c.Do("SADD", v, splitted[k+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
func (r *Runner) getJSON() { | |
thread := strconv.Itoa(r.thread) | |
jsonURL := "http://a.4cdn.org/" + r.board + "/thread/" + thread + ".json" | |
resp, err := http.Get(jsonURL) | |
if err != nil { | |
log.Fatal(err) | |
} | |
defer resp.Body.Close() | |
body, err := ioutil.ReadAll(resp.Body) |
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
private class CallAPI extends AsyncTask<String, String, JSONArray> { | |
JSONArray jArray; | |
@Override | |
protected JSONArray doInBackground(String... urls) { | |
try { | |
URL url = new URL(getString(R.string.api_url)); | |
HttpURLConnection httpCon = (HttpURLConnection) url.openConnection(); | |
httpCon.setRequestMethod("GET"); |
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
### Keybase proof | |
I hereby claim: | |
* I am blackdev1l on github. | |
* I am blackdev1l (https://keybase.io/blackdev1l) on keybase. | |
* I have a public key whose fingerprint is 3753 7A16 5254 D650 223D 7F07 8216 1FD3 4C14 2D96 | |
To claim this, I am signing this object: |