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/python | |
# -*- coding: utf8 -*- | |
import codecs | |
import random | |
def shuffle_text_paragraphs(file_path, output_file_path): | |
""" | |
Args: |
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
<VirtualHost *:80> | |
<some code> | |
RewriteEngine on | |
RewriteCond %{SERVER_NAME} =raplyrics.eu [OR] | |
RewriteCond %{SERVER_NAME} =www.raplyrics.eu | |
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] | |
</VirtualHost> |
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
<IfModule mod_ssl.c> | |
<VirtualHost *:443> | |
<some code> | |
ProxyPreserveHost On | |
ProxyPass /apiUS http://127.0.0.1:8000/apiUS | |
ProxyPassReverse /apiUS https://127.0.0.1:8000/apiUS | |
<some code> |
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
""" | |
Sample extract transform load pipeline to illustrate how Nifi can simplify the construction | |
of a dataflow. | |
NOTE: This code is simply to illustrate an idea and is not a working ETL pipeline. | |
""" | |
import os | |
import db_utils |
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
class Solution: | |
def minAvailableDuration(self, slots1: List[List[int]], slots2: List[List[int]], duration: int) -> List[int]: | |
n1 = len(slots1) | |
n2 = len(slots2) | |
if n1 == 0 or n2 == 0: | |
return [] | |
idx1 = 0 | |
idx2 = 0 |
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
// Update is a Telegram object that the handler receives every time an user interacts with the bot. | |
type Update struct { | |
UpdateId int `json:"update_id"` | |
Message Message `json:"message"` | |
} |
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
// Message is a Telegram object that can be found in an update. | |
type Message struct { | |
Text string `json:"text"` | |
Chat Chat `json:"chat"` | |
} |
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
// A Telegram Chat indicates the conversation to which the message belongs. | |
type Chat struct { | |
Id int `json:"id"` | |
} |
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
// parseTelegramRequest handles incoming update from the Telegram web hook | |
func parseTelegramRequest(r *http.Request) (*Update, error) { | |
var update Update | |
if err := json.NewDecoder(r.Body).Decode(&update); err != nil { | |
log.Printf("could not decode incoming update %s", err.Error()) | |
return nil, err | |
} | |
return &update, nil | |
} |
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
// HandleTelegramWebHook sends a message back to the chat with a punchline starting by the message provided by the user. | |
func HandleTelegramWebHook(w http.ResponseWriter, r *http.Request) { | |
// Parse incoming request | |
var update, err = parseTelegramRequest(r) | |
if err != nil { | |
log.Printf("error parsing update, %s", err.Error()) | |
return | |
} |
OlderNewer