Skip to content

Instantly share code, notes, and snippets.

View remixer-dec's full-sized avatar
☮️
make software, not war

Remixer Dec remixer-dec

☮️
make software, not war
View GitHub Profile
@remixer-dec
remixer-dec / run_msi_on_windows_for_arm.txt
Last active February 8, 2022 10:06
Install x86 / x64 MSI on Windows for ARM
How to fix the error "This version of ... is designed to run on a 32-bit windows operating system" on ARM version of windows?
Run this command in the cmd with your msi file.
msiexec -i FILENAME.MSI /passive
Element.prototype.createEvent = function(name, ...params) {
return new CustomEvent(name, ...params)
}
console.info = function(...args) {
console.log(...args)
}
//this is just a placeholder
class SVGElement {
@remixer-dec
remixer-dec / color_utils.py
Created July 25, 2020 19:48
HSL to RGB, RGB to INT convertion for micropython
#input: [H (0 to 360), S (0 to 100), L (0 to 100)]
#output: [R (0 to 255), G (0 to 255), B (0 to 255)]
#reference: https://gist.github.com/PaulKinlan/d4053acfffd49abfa197a8d370a18337
def hsl_to_rgb(HSLlist):
H, S, L = HSLlist
S = S / 100
L = L / 100
C = (1 - abs(2 * L - 1)) * S
X = C * (1 - abs(((H / 60) % 2) - 1))
m = L - C / 2;
@remixer-dec
remixer-dec / FixedSizeArrayLiFo.js
Created May 8, 2020 13:32
Fixed size / length array (LiFo) for infinite pushing
//Warning: fixed size is only kept for .push() method
//Usage:
//let arr = new FixedSizeArrayLifo(2)
//arr.push(123); ...
class FixedSizeArrayLiFo extends Array {
constructor(size) {
super()
this.#size = size
}
@remixer-dec
remixer-dec / jarhasher.js
Last active August 26, 2022 12:35
Node script for hashing J2ME JAR files, excluding editable parts
// MULTI-CORE J2ME JAR HASHER | EXCLUDES EVERYTHING INSIDE MANIFEST FOLDER TO IGNORE MANIFEST-ONLY-CHANGES | (c) Remixer Dec 2019 | License: CC BY-NC 4.0
// usage: node jarhasher.js "C:/path/to/folder_with_jar_files_only_with_forward_slashes" CPU_LOGICAL_CORES HASHLIMIT
// output: 2 files hashed.json, corrupted.json
// output format: [["filename","md5","sha1"],...]
const os = require('os')
const JSZip = require("jszip");
const fs = require("fs")
const crypto = require('crypto')
const cluster = require('cluster');
@remixer-dec
remixer-dec / vk_msg_bot.py
Created July 17, 2019 16:58
Бот для ВК, разработанный под ESP8266 с Micropython.
import urequests as rq
import utime as t
class VKAPI(object):
def __init__(self):
self.token = "REPLACE_THIS_WITH_YOUR_TOKEN"
def _sendRequest(self, method, prm):
prm["access_token"] = self.token
prm["v"] = "5.101"
par = self._q(prm)
qu = "https://api.vk.com/method/"+method+"/?"+par
@remixer-dec
remixer-dec / cpu_usage_logger.js
Last active January 2, 2019 23:41
NodeJS script to detect and log CPU usage per process (for example when PC is in lockscreen or in pseudo-sleep-mode) | run cmd as admin to get all processes
const ps = require('current-processes')
const _ = require('lodash')
const fs = require('fs')
function saveData(){
ps.get(function(err, processes) {
for(let prc of processes){
delete prc.mem
}
let sorted = _.sortBy(processes, 'cpu')
@remixer-dec
remixer-dec / LICENSE
Created August 24, 2018 20:31
500B JS Snake
Public Domain
@remixer-dec
remixer-dec / init.coffee
Created February 7, 2018 12:49
Switching tabs (panes) in Atom using mousewheel left/right keys
addEventListener 'mousewheel', (e) ->
switch e.deltaX
when -100
atom.workspace.getActivePane().activatePreviousItem()
when 100
atom.workspace.getActivePane().activateNextItem()
return
@remixer-dec
remixer-dec / UnityAssetMergerGenerator.js
Created July 16, 2017 16:59
generates a .bat file content to merge unity assets
function UnityAssetMergerGenerator(assetnum,assetparts){
var q = 'copy /b ';
for(var i=0;i<=assetparts;i++){ q+='"sharedassets'+assetnum+'.assets.split'+i+'" + ' }
q = q.substr(0,q.length-2) + '"sharedassets'+assetnum+'.assets"'
return q;
}