Skip to content

Instantly share code, notes, and snippets.

View marcelogrsp's full-sized avatar

Marcelo Gazzola Ribeiro marcelogrsp

View GitHub Profile
server {
listen 80 default_server;
listen [::]:80 default_server;
location /api {
proxy_pass http://localhost:5000/api;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
set $cors '';
UC_FIRST Capitalize any given string - This function is a clone of the ucfirst function in PHP.
DROP FUNCTION IF EXISTS UC_FIRST;
CREATE FUNCTION UC_FIRST(oldWord VARCHAR(255)) RETURNS VARCHAR(255)
RETURN CONCAT(UCASE(SUBSTRING(oldWord, 1, 1)),SUBSTRING(oldWord, 2));
UC_DELIMITER Capitalize with a delimiter in between words
DROP FUNCTION IF EXISTS UC_DELIMITER;
DELIMITER //
CREATE FUNCTION UC_DELIMITER(
DELIMITER $$
CREATE TRIGGER `MODIFIED_DATE` BEFORE UPDATE ON `TBL_COMPANIES`
FOR EACH ROW
BEGIN
IF (NEW.Operator_name is not null) THEN
SET NEW.Modified = CURRENT_TIMESTAMP();
END IF;
DELIMITER $$
CREATE TRIGGER `TRIGGER_NAME` BEFORE UPDATE ON `TABLE_NAME`
FOR EACH ROW
BEGIN
IF (NEW.FIELD_NAME is not null) THEN
SET NEW.FIELD_NAME = CURRENT_TIMESTAMP();
END IF;
Sub request()
Dim request As HttpWebRequest = HttpWebRequest.Create("https://www.python.org/ftp/python/3.8.3/python-3.8.3-amd64.exe")
request.Proxy = Nothing
Dim response As HttpWebResponse = request.GetResponse
Dim responseStream As System.IO.Stream = response.GetResponseStream
Dim streamReader As New System.IO.StreamReader(responseStream)
Dim data As String = streamReader.ReadToEnd
streamReader.Close()