Skip to content

Instantly share code, notes, and snippets.

View mervick's full-sized avatar

Andrey Izman mervick

View GitHub Profile
@mervick
mervick / aaa_catalina_vm_virtualbox_install.md
Created June 2, 2020 02:14
Catalina VM VirtualBox Install

Catalina VirtualBox Setup

Setting up macOS/OSX Catalina for VirtualBox enabling 256MB of VRAM.

Install

Using the myspaghetti macos-guest-virtualbox github repo.

git clone git@github.com:myspaghetti/macos-guest-virtualbox.git

cd macos-guest-virtualbox

/**
* @author mrdoob / http://mrdoob.com/
* @author supereggbert / http://www.paulbrunt.co.uk/
* @author julianwa / https://github.com/julianwa
*/
THREE.RenderableObject = function () {
this.id = 0;
@mervick
mervick / strtr.js
Created October 18, 2019 21:03 — forked from dsheiko/strtr.js
Java-script strtr — translate characters or replace substrings
/**
* strtr() for JavaScript
* Translate characters or replace substrings
*
* @author Dmitry Sheiko
* @version strtr.js, v 1.0.1
* @license MIT
* @copyright (c) Dmitry Sheiko http://dsheiko.com
**/
@mervick
mervick / sha_aes_utility.kt
Created September 20, 2019 10:51 — forked from reuniware/sha_aes_utility.kt
Android Kotlin : SHA-1 Hash and AES Encryption/Decryption and Storing password, secretKey, IV and Hash in Shared Preferences
fun hashAndSavePasswordHash(context: Context, clearPassword: String) {
val digest = MessageDigest.getInstance("SHA-1")
val result = digest.digest(clearPassword.toByteArray(Charsets.UTF_8))
val sb = StringBuilder()
for (b in result) {
sb.append(String.format("%02X", b))
}
val hashedPassword = sb.toString()
val sharedPref = PreferenceManager.getDefaultSharedPreferences(context)
val editor = sharedPref.edit()
@mervick
mervick / gist:b32596f659f0905f2960bdef572d187d
Created September 18, 2019 01:42 — forked from RiANOl/gist:1077760
AES128 / AES256 CBC with PKCS7Padding in Ruby
require "openssl"
require "digest"
def aes128_cbc_encrypt(key, data, iv)
key = Digest::MD5.digest(key) if(key.kind_of?(String) && 16 != key.bytesize)
iv = Digest::MD5.digest(iv) if(iv.kind_of?(String) && 16 != iv.bytesize)
aes = OpenSSL::Cipher.new('AES-128-CBC')
aes.encrypt
aes.key = key
aes.iv = iv
@mervick
mervick / ffmpeg.md
Created May 24, 2019 22:10 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@mervick
mervick / linux-usb-file-copy-fix.md
Created December 13, 2018 03:19 — forked from 2E0PGS/linux-usb-file-copy-fix.md
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@mervick
mervick / gist:0e72cebde566c2272ab8aec2c0e62c54
Created December 1, 2018 00:53 — forked from wlbr/gist:1685405
Create a git repo with a central repository server.

##Create a git repo with a central repository server.

Step 1: Connect to server, create a new, empty directory there and initialize an empty repository.

$ ssh server.com
Last login ...
Welcome to server.com!
> mkdir myrepo.git 
> cd myrepo.git

> git --bare init

@mervick
mervick / SassMeister-output.css
Created September 4, 2018 06:39 — forked from mturnwall/SassMeister-output.css
SASS mixin for styling input placeholder text
::-moz-placeholder {
color: red;
font-weight: 300;
padding-top: 5px;
}
::-webkit-input-placeholder {
color: red;
font-weight: 300;
padding-top: 5px;
@mervick
mervick / mixins.scss
Created September 4, 2018 06:30 — forked from charlieschwabacher/mixins.scss
SCSS mixins for cross browser CSS3 border-radius, transition, gradient, and box shadow
//Cross browser CSS3 mixins
@mixin box-shadow($left, $top, $radius, $color) {
box-shadow: $left $top $radius $color;
-webkit-box-shadow: $left $top $radius $color;
-moz-box-shadow: $left $top $radius $color;
}
@mixin transition($property, $duration, $easing: linear) {
transition: $property $duration $easing;