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 ( | |
"github.com/go-chi/chi" | |
"github.com/go-chi/chi/middleware" | |
_ "github.com/go-sql-driver/mysql" | |
) | |
var router *chi.Mux | |
var db *sql.DB |
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
#include <sstream> | |
stringstream ss; | |
string s; //main string | |
string newString; //new string | |
ss << s; //assign s to ss | |
while(ss >> newString) { // Spilit 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
PREFIX ab: <http://learningsparql.com/ns/addressbook#> | |
SELECT ?name | |
WHERE { | |
?name ab:email "richard49@hotmail.com" . | |
} |
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
@prefix ab: <http://learningsparql.com/ns/addressbook#> . | |
ab:ali_gatie ab:borns "Yemen" . | |
ab:ali_gatie ab:homeTel "01700000" . | |
ab:ali_gatie ab:email "ali_gatie@hotmail.com" . | |
# If we want to add more person... | |
ab:richard ab:borns "Berlin" . | |
ab:richard ab:homeTel "01700001" . | |
ab:richard ab:email "richard49@hotmail.com" . |
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
@prefix ab: <http://learningsparql.com/ns/addressbook#> . | |
ab:ali_gatie ab:borns "Yemen" ; | |
ab:homeTel "01700000" ; | |
ab:email "ali_gatie@hotmail.com" . | |
# If we want to add more person... | |
ab:richard ab:borns "Berlin" ; | |
ab:homeTel "01700001" ; | |
ab:email "richard49@hotmail.com" . |
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
type Post struct { | |
ID int `json: "id"` | |
Title string `json: "title"` | |
Content string `json: "content"` | |
} |
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 post | |
import ( | |
"context" | |
"database/sql" | |
models "github.com/s1s1ty/go-mysql-crud/models" | |
pRepo "github.com/s1s1ty/go-mysql-crud/repository" | |
) |
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
input { | |
elasticsearch { | |
hosts => "localhost:9200" | |
index => "give_index_name" | |
query => ' | |
{ | |
"query": { | |
"match_all": {} | |
} | |
} |
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
# delete all data from _doc | |
curl -XPOST 'localhost:9200/pathao/zone_path/_delete_by_query?conflicts=proceed&pretty' -d' | |
{ | |
"query": { | |
"match_all": {} | |
} | |
}' | |
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
#!/bin/python3 | |
S = input().strip() | |
try: | |
print(int(S)) | |
except ValueError: | |
print('Bad String') |
NewerOlder