This file contains hidden or 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 AppKit | |
import ApplicationServices | |
import CoreGraphics | |
import Foundation | |
// Declare the private _AXUIElementGetWindow API | |
@_silgen_name("_AXUIElementGetWindow") | |
func _AXUIElementGetWindow(_ element: AXUIElement, _ windowID: UnsafeMutablePointer<CGWindowID>) | |
-> AXError |
This file contains hidden or 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 Cocoa | |
class AppDelegate: NSObject, NSApplicationDelegate { | |
var window: NSWindow! | |
func applicationDidFinishLaunching(_ notification: Notification) { | |
// Définir l'icône de l'application | |
if let image = createApplicationIcon() { | |
NSApplication.shared.applicationIconImage = image | |
} |
This file contains hidden or 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
(function() { | |
'use strict'; | |
class ConfigurablePanel { | |
constructor() { | |
this.position = 'right'; | |
this.isDragging = false; | |
this.isResizing = false; | |
this.offset = { x: 0, y: 0 }; | |
this.createPanel(); |
This file contains hidden or 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
#!/bin/bash | |
twitchVideoId=$(basename $1) | |
curl -ss --location --request GET "https://api.twitch.tv/kraken/videos/$twitchVideoId" \ | |
--header 'Client-Id: kimne78kx3ncx6brgo4mv6wki5h1ko' \ | |
--header 'Accept: application/vnd.twitchtv.v5+json' \ | |
| jq -r '.animated_preview_url' \ | |
| sed 's/\/storyboards.*/\/chunked\/index-dvr.m3u8/' |
This file contains hidden or 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
#!/bin/bash | |
osascript << EOF | |
set windowFounded to 0 | |
set tabFounded to 0 | |
tell application "$1" | |
set window_list to every window | |
set counter_window to 0 |
This file contains hidden or 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
function _pgcd(a, b) { | |
if (b) { | |
return _pgcd(b, a % b); | |
} else { | |
return Math.abs(a); | |
} | |
} | |
const createRatio = (width, height, color) => { | |
return { ratio: width / height, width, height, color }; |
This file contains hidden or 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
// example in the body | |
// paste it in the chrome console | |
let raw = ` | |
APP_NAME=Laravel | |
APP_ENV=local | |
`; | |
raw = raw.split('\n').filter(str => str.length > 0 && str[0] != '#') |