This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def get_window_name_with_applescript(): | |
window_name = os.popen("osascript -e 'tell application \"System Events\" to get the name of window 1 of (first application process whose frontmost is true)'").read().strip() | |
process_name = os.popen("osascript -e 'tell application \"System Events\" to get the name of (first application process whose frontmost is true)'").read().strip() | |
return window_name, process_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Domain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener 'mousewheel', (e) -> | |
switch e.deltaX | |
when -100 | |
atom.workspace.getActivePane().activatePreviousItem() | |
when 100 | |
atom.workspace.getActivePane().activateNextItem() | |
return |
NewerOlder