Skip to content

Instantly share code, notes, and snippets.

View heitara's full-sized avatar
💻
Swift & SwiftUI

Emil Atanasov heitara

💻
Swift & SwiftUI
View GitHub Profile
@heitara
heitara / mssql-in-parallels-on-mac-m1.md
Created May 17, 2024 22:24
How to run MSSQL on Windows 11 in Parallels on a Mac with M1/M2/M3 processor

How to install MSSSQL on a mac with Apple M1 processor

The real problem comes from this new architecture. First, you have to install Parallels, which is quite easy. Just follow the installation guide. Then you have to install Windows 11, which is part of Parallels. So far, so good. Then you have go to the foolowing github repo https://github.com/jimm98y/MSSQLEXPRESS-M1-Install. Use the download button (Click on Code button and pick 'Download ZIP'). Extract this somewhere on your C:\ drive on the virtual machinve (Win11 VM).

The following steps might be accomplished from WindowsExplorer, but don't forget to start it as Administrator.

@heitara
heitara / sed.md
Last active April 12, 2024 20:41
Useful sed commands for macOS

Here are some useful sed commands for file editing

sed 10q demo.txt - prints first 10 lines

sed -i'.bak' 's/hello/bar/' demo.txt - replace the first "hello" on each line with "bar"

sed -i'.bak' 's/hello/bar/g' demo.txt - replace the ALL "hello" on each line with "bar"

sed -i'.bak' '3d' demo.txt - remove the 3rd line in a file

@heitara
heitara / resotre-dmg-to-sdcard.md
Last active May 10, 2024 13:13
How to restor dmg (copy of FAT sdcard) to a new sdcard

How to restore an image (.dmg) to a sdcard?

The image you want to use when recovering should be crated earlier. The sdcard should be empty or the data on it will be lost.

First, the image should be converted to a pure image. This can be done with the following command:

hdiutil convert sdcard_image.dmg -format UDTO -o sdcard_pure_image.img
@heitara
heitara / mkcert-README.md
Last active January 31, 2022 14:09
How to fix problems with mkcert

If you face any problems like missig keystore

" keytool error: java.lang.Exception: Keystore file does not exist: "

You have to create a default keystore in your JAVA_HOME.

JAVA_HOME/jre/lib/security/cacerts cacerts default password is changeit. This file is important and should be secured. You can read more here

Once that's done you should be able to use mkcert.

//this is jsut the "meat" of the solution
const PEPPERFLASH_PLUGIN = 'resources/pepperFlash/mac/PepperFlashPlayer.plugin'
let pluginName
let pluginDir = __dirname
switch (process.platform) {
case 'win32':
switch (process.arch) {
case "x64":
pluginName = PEPPERFLASH_PLUGIN_WIN64
break;
{
"asarUnpack" : ["resources/pepperFlash/mac"]
}
@heitara
heitara / electron.pepper.flash.index.js
Last active July 31, 2020 23:47
How to load properly PepperFlash in Electron on Mac
//this is jsut the "meat" of the solution
const PEPPERFLASH_PLUGIN = __dirname.indexOf("asar") >=0 ? '../resources/pepperFlash/mac/PepperFlashPlayer.plugin' : 'resources/pepperFlash/mac/PepperFlashPlayer.plugin'
let pluginName
switch (process.platform) {
case 'win32':
switch (process.arch) {
case "x64":
pluginName = PEPPERFLASH_PLUGIN_WIN64
break;
default:
@heitara
heitara / numbertotext-bg.js
Last active June 2, 2020 16:28
Number to text, number to words, Словом, Число в текст на български
let toBGN = (value) => {
let under10 = (value, currency = false) => {
let index = Math.floor(value)
if(index > 10) {
index = 10;
}
let resultArray =
[
"нула", "един", "два", "три", "четири", "пет", "шест",
@heitara
heitara / imagemagick.shell.sh
Created May 3, 2020 07:56
Image Magick resize buch of images
#!/bin/bash
FILES=*.jpg
mkdir out
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f store current file name
convert $f -resize 2000x2000\> out/$f
done