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
<?php | |
#путь к файлу с будущими логами | |
$log_path = './logs/' . date("ymd") . '.txt'; | |
#берем из переменной окружения ip-адрес посетителя... | |
$user_ip = getenv(REMOTE_ADDR ); | |
#... и его тип браузера | |
$user_brouser = getenv(HTTP_USER_AGENT); | |
#узнаем сегодняшнее число и время | |
$curent_time = date("ymd H:i:s"); | |
#Компонуем все данные в одну строку (для удобства) |
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
/* Although the method works, it would be better to check the installed versions | |
of .NET Framework in this article (there is a code to determine the version in C#): | |
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed | |
*/ | |
private static bool IsNetFramework45Installed() { | |
Type type; | |
try { | |
type = TryGetDefaultDllImportSearchPathsAttributeType(); | |
} catch (TypeLoadException) { |
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
// Written in the D Programming Language, version 2 | |
import std.stdio; | |
import std.string; | |
import std.conv; | |
import std.math; | |
import std.exception; | |
int main(string[] 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
using System.Collections.Specialized; | |
using System.Text; | |
using VitNX.Functions.Common.Web; | |
namespace FileUploader | |
{ | |
class Demo | |
{ | |
public static void Upload() | |
{ |
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
// Compress | |
byte[] compressed = Data.CompressAndDecompress.CompressBytes(Data.CompressAndDecompress.GetBytes(input)); | |
string output = Encoding.UTF8.GetString(compressed); | |
// Decompress | |
string output = Data.CompressAndDecompress.BytesToString(Data.CompressAndDecompress.DecompressBytes(compressed)); |
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 os | |
import random | |
import shutil | |
import string | |
from os import system | |
from random import randrange | |
import time | |
import requests | |
import uuid | |
from bs4 import BeautifulSoup as BSHTML |
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 PerformanceCounter PCounter = new PerformanceCounter(); | |
// Your code | |
PCounter.Start();// Start measure | |
// Your code for measurements | |
double interval = PCounter.End(); // Result interval in seconds |
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
// Gets the clipboard text | |
GetClipboardText GetClipboard = new GetClipboardText(); | |
string output = GetClipboard.GetText(); | |
// Sets the clipboard text | |
string input = "Hello World!"; | |
await SetClipboardText.Run(() => System.Windows.Forms.Clipboard.SetText(input)); |
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
string request = Post("https://site.com/auth", "client_id=43435&key=create"); |
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
ServicePointManager.SecurityProtocol = VitNX3.Functions.Web.Config.UseProtocols(); |
OlderNewer