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
cd "C:%HOMEPATH%\.IntelliJIdea*\config" | |
rmdir "eval" /s /q | |
del "options\other.xml" | |
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f | |
:: This will work for idea 2018.3 and later | |
:: | |
:: It is Highly Advised to Purchase the JetBrain Softwares | |
:: This is only for the case You just want to Extend the | |
:: Trial Period and Evaluate the IDE for some more Time |
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
// ==UserScript== | |
// @name VirginRadio Reducer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.6 | |
// @description Removes unnecessary parts from virginradio.it | |
// @author Christian Castelli <voodoo81people@gmail.com> | |
// @match https://www.virginradio.it/* | |
// @grant none | |
// ==/UserScript== |
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
const isLocalhost = Boolean( | |
window.location.hostname === 'localhost' || | |
// [::1] is the IPv6 localhost address. | |
window.location.hostname === '[::1]' || | |
// 127.0.0.1/8 is considered localhost for IPv4. | |
window.location.hostname.match( | |
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/, | |
), | |
); |
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
const crypto = require('crypto'); | |
const fs = require('fs'); | |
/** | |
* It calculates the hash of a file | |
* @param {string} hashName type of hash (md5, sha1, etc) | |
* @param {string|Stream} file a file's path or a readable stream | |
* if it's been already opened somewhere else | |
*/ | |
function getFileHash(hashName, file) { |
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
# dump of your database in plain text. It creates tables, views, etc | |
# for exporting multiple tables only, you can repeat parameter -t | |
pg_dump --host <IP> --port 5432 --username "myuser" \ | |
--format plain --create --encoding UTF8 -v \ | |
--file "/my/path/file.sql" "db_name" | |
# or, with short opts and wrapping all SQL statements inside a transaction with automatic ROLLBACK | |
psql -U postgres -p 5433 --single-transaction -f /my/path/file.sql db_name | |
# Import of a SQL dump. Be sure to have write permissions in the current directory |
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
/* $2$(2 chars work)$(22 chars salt)(31 chars hash) | |
* 2 - the original BCrypt, which has been deprecated because of a security issue a long time before BCrypt became popular. | |
* 2a - the official BCrypt algorithm and a insecure implementation in crypt_blowfish | |
* 2x - suggested for hashes created by the insecure algorithm for compatibility | |
* 2y - suggested new marker for the fixed crypt_blowfish | |
* | |
* So 2a hashes created by the original algorithm or the java port are fine, and identical to 2y-hashes created by | |
* crypt_blowfish. But 2a hashes created by crypt_blowfish are insecure. */ | |
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
/** | |
* Apache HTTP Fluent client configuration | |
* @throws KeyStoreException | |
* @throws NoSuchAlgorithmException | |
* @throws KeyManagementException | |
* @throws IOException | |
* @throws CertificateException | |
*/ | |
public static void httpClientConfigurator() throws KeyStoreException, KeyManagementException, NoSuchAlgorithmException, | |
CertificateException, IOException { |
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 | |
# use composer : php composer.phar require swiftmailer/swiftmailer @stable | |
require __DIR__ . '/vendor/autoload.php'; | |
// Approach 1: Change the global setting (suggested) | |
Swift_Preferences::getInstance()->setCharset('utf-8'); | |
$smtp_host = '1.2.3.4'; | |
// Create the Transport | |
$transport = Swift_SmtpTransport::newInstance($smtp_host, 25); | |
// Create the Mailer using your created Transport |
NewerOlder