Skip to content

Instantly share code, notes, and snippets.

@davidalger
davidalger / install-php-sodium-on-el8.md
Created December 2, 2019 17:50
Install php-sodium on EL 8

There is currently no pre-built package available for the php sodium ext currently. And due to the changes made to the EL 8 packaging system, IUS no longer plans to maintain any packages for EL 8 (alternate versions of packages such as PHP should eventually become available via additional module streams published in the AppStream repo) so it's not available via IUS either beyond EL 7.

Magento will fallback on sha256 for password hashes when sodium is unavailable:

public function getLatestHashVersion(): int
{
    if (extension_loaded('sodium') && defined('SODIUM_CRYPTO_PWHASH_ALG_ARGON2ID13')) {
        return self::HASH_VERSION_ARGON2ID13;
    }

return self::HASH_VERSION_SHA256;

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

DROP TABLE IF EXISTS SQLShackGeomTest;
CREATE TABLE SQLShackGeomTest (
sensor_id VARCHAR(50) PRIMARY KEY NOT NULL,
longitude VARCHAR(50),
latitude VARCHAR(50),
country TEXT,
sensorTemp INTEGER,
sensorPressure INTEGER,
sensorTime TIMESTAMP,
@roycoding
roycoding / Neural_net_warping_tutorial.ipynb
Last active April 18, 2024 17:21
Feature space warping by neural networks
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};
@adrianhajdin
adrianhajdin / constants.js
Created March 3, 2023 09:28
Build and Deploy an Amazing 3D Web Developer Portfolio with ThreeJS | React Three Fiber
import {
mobile,
backend,
creator,
web,
javascript,
typescript,
html,
css,
reactjs,
@dragonfire1119
dragonfire1119 / how-to-ssh-into-a-proxmox-container.md
Created June 19, 2023 13:32
How to SSH into a Proxmox container

Proxmox

So if you're using Proxmox you need to open up ssh and run the following commands:

  1. Setup a root password
sudo passwd root
@zihotki
zihotki / Lighter or Darker a Color.cs
Created December 17, 2017 00:17
.net C# make a color lighter or darker
/// <summary>
/// Creates color with corrected brightness.
/// </summary>
/// <param name="color">Color to correct.</param>
/// <param name="correctionFactor">The brightness correction factor. Must be between -1 and 1.
/// Negative values produce darker colors.</param>
/// <returns>
/// Corrected <see cref="Color"/> structure.
/// </returns>
public static Color ChangeColorBrightness(Color color, float correctionFactor)
@ullaskunder3
ullaskunder3 / README.md
Last active April 18, 2024 17:08
Detail flutter installation without android studio just using cmdline-tools, git, cmd
@inogo
inogo / yandex_search_regions.csv
Created February 7, 2020 09:38
Список кодов регионов поиска Яндекса (параметр &lr=) ранее был доступен по ссылке https://yandex.ru/yaca/geo.c2n
We can't make this file beautiful and searchable because it's too large.
1,"Москва и Московская область"
2,"Санкт-Петербург"
3,"Центральный федеральный округ"
4,"Белгород"
5,"Иваново"
6,"Калуга"
7,"Кострома"
8,"Курск"
9,"Липецк"