Skip to content

Instantly share code, notes, and snippets.

View mim-Armand's full-sized avatar
🔦
Kugelblitz!

Armand mim-Armand

🔦
Kugelblitz!
View GitHub Profile
@mim-Armand
mim-Armand / create_dictionary.py
Created December 23, 2024 07:06
Convert a css file to a dictionary to be used with AI/ML (MFA)
import csv
def create_hebrew_dictionary(
input_csv="hebrew_frequency.csv",
output_dict="hebrew_dictionary.txt"
):
"""
Reads the CSV file from the scrape script and creates
a Hebrew -> Transliteration dictionary (or any mapping you choose).
Saves it in a simple text file for demonstration.
@mim-Armand
mim-Armand / scrape_hebrew_frequency.py
Created December 23, 2024 07:01
Scrape a page for Hebrew words dictionary
import requests
from bs4 import BeautifulSoup
import csv
def scrape_hebrew_frequency_list(output_csv="hebrew_frequency.csv"):
"""
Scrapes the Hebrew frequency table from TeachMeHebrew, merges rows with missing 'Rank',
and saves all table columns to a CSV file.
"""
url = "https://www.teachmehebrew.com/hebrew-frequency-list.html"
@mim-Armand
mim-Armand / txt_to_wordsfile.py
Created December 23, 2024 04:55
txt to word-per-line
import sys
import os
# Configurable variables
DEFAULT_INPUT_FILE = "001_001.txt"
DEFAULT_OUTPUT_FILE = "unique_words_001_001.txt"
def extract_unique_words(input_file, output_file):
try:
# Read the content of the file
@mim-Armand
mim-Armand / Conemu_startup_v1
Created August 23, 2016 17:27
An startup script for my conemu
-cur_console:t:'GIT' bash
-new_console:s1T50V -cur_console:t:"2b" powershell -NoExit -command [enum]::GetValues([System.ConsoleColor]) | Foreach-Object {Write-Host $_ -ForegroundColor $_}; cd desktop; netstat 333;
-new_console:s1T50H -cur_console:t:"3b" powershell -NoExit -command Write-Output 'Good morining mim!' -v; Write-Warning 'Main PS console'; $colors = $host.PrivateData; $colors.VerboseForegroundColor = 15; $colors.VerboseBackgroundColor = 9;$colors.WarningForegroundColor = 14; $colors.WarningBackgroundColor = 2; $colors.ErrorForegroundColor = 15; $colors.ErrorBackgroundColor = 12; cd desktop;
-new_console:s2T50H -cur_console:t:"4b" far C:/Users/mim/Desktop
-new_console:s2T50H -cur_console:t:"W1" powershell -NoExit -command Write-Verbose 'Goodmorining mim!' -v; $console = $host.UI.RawUI;$console.ForegroundColor = 15;$console.BackgroundColor = 1; start-sleep 3; $colors = $host.PrivateData; $colors.VerboseForegroundColor = 15; $colors.VerboseBackgroundColor = 9;$colors.WarningForegroundColor = 14; $col
@mim-Armand
mim-Armand / objToArray.js
Last active August 29, 2015 14:04
getting an array of Object properties in older Versions of JavaScript
Object.objToArray = function(obj) {
var array = [];
for (key in obj) {
if (obj.hasOwnProperty(key)) array.push(key);
}
return array;
};
alert(Object.objToArray(YourObject));
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
if (!Object.keys) {
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
@mim-Armand
mim-Armand / jsx_reflection.jsx
Created July 13, 2014 20:22
using this methode you can get all the related attributes , contents, etc. of any ExtensScript object! very helpful in writing ES codes!
var f = this;
var t = '';
var props = f.reflect.properties;
for (var i = 0; i < props.length; i++) {
t += ('this property ' + props[i].name + ' is ' + f[props[i].name] + "\n");
}
alert(t);
void setup(){
ImageIcon titlebaricon = new ImageIcon(loadBytes("myicon.png"));
frame.setIconImage(titlebaricon.getImage());
}
var myPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
alert(myPath);
var myPath = app.activeDocument.filePath;
alert(myPath);