Skip to content

Instantly share code, notes, and snippets.

hard as a rock

Christian Castelli chrisvoo

hard as a rock
Block or report user

Report or block chrisvoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
chrisvoo / IntelIJTrialReset.bat
Created Feb 17, 2020
How to Reset InteIIiJ IDEA Evaluation Key in Windows
View IntelIJTrialReset.bat
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
chrisvoo / VirginRadioReducer.user.js
Last active Sep 19, 2019
Removes unnecessary parts from
View VirginRadioReducer.user.js
// ==UserScript==
// @name VirginRadio Reducer
// @namespace
// @version 0.6
// @description Removes unnecessary parts from
// @author Christian Castelli <>
// @match*
// @grant none
// ==/UserScript==
chrisvoo / redis.js
Created Mar 19, 2019
Node.js and Redis: async GET/SET
View redis.js
const redis = require("redis")
const { promisify } = require("util")
const {
redis: { clientOptions, expire },
} = require("../config/get-config")
let client
* Asynchronous version of `client.get`
chrisvoo / isLocalhost.js
Created Feb 21, 2019
Tests if the scripts is running in local (taken from registerServiceWorker.js - CRA apps)
View isLocalhost.js
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// is considered localhost for IPv4.
chrisvoo / getFileHash.js
Created Feb 19, 2019
Node.js: function to create an hash from a file (path or Buffer)
View getFileHash.js
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) {
chrisvoo /
Last active Jul 4, 2017
Converts a FLAC file to MP3 with ffmpeg and lame encoder
to_mp3() {
filename=$(basename "$1")
ffmpeg -i "$1" -codec:a libmp3lame -b:a 320k -map_metadata 0 -id3v2_version 3 ${filename}.mp3
chrisvoo / email_test.php
Created Dec 2, 2015
Testing external SMTP server with PHP
View email_test.php
# use composer : php composer.phar require swiftmailer/swiftmailer @stable
require __DIR__ . '/vendor/autoload.php';
// Approach 1: Change the global setting (suggested)
$smtp_host = '';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance($smtp_host, 25);
// Create the Mailer using your created Transport
chrisvoo /
Last active Sep 23, 2016
GET/POST HTTP JSON request with Apache Fluent library (libphonenumber Google library)
* 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 {
chrisvoo / bcrypt.txt
Last active Oct 6, 2016
BCrypt implementations
View bcrypt.txt
/* $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. */
chrisvoo /
Last active Nov 27, 2019
GET/POST HTTP request and HTML parsing with Jsoup library
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
You can’t perform that action at this time.