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 Cocoa | |
import Foundation | |
class ViewController: NSViewController { | |
private func promptForWorkingDirectoryPermission() -> URL? { | |
let openPanel = NSOpenPanel() | |
openPanel.message = "Choose home directory" | |
openPanel.prompt = "Choose" | |
openPanel.allowedFileTypes = ["none"] |
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
window.__tcfapi = (command, parameter, callback) => { | |
if (command === 'checkConsent') { | |
callback(true); | |
} | |
if (command === 'addEventListener') { | |
callback({eventStatus: 'tcloaded', gdprApplies: false}, true); | |
} | |
}; |
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
require 'xcodeproj' | |
project_path = ARGV[0] | |
project = Xcodeproj::Project.open(project_path) | |
xcodebuild = `xcodebuild -project '#{project_path}' -showBuildSettings` | |
build_settings = xcodebuild.scan(/([A-Z_]*) = (.*?)\n/).to_h | |
missing_files = [] | |
project.files.to_a.each do |file| | |
absolute_path = file.real_path |
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
// clang -framework IOKit -framework Carbon iOS-keyboard-issue.c -o iOS-keyboard-issue && ./iOS-keyboard-issue | |
#include <Carbon/Carbon.h> | |
#include <IOKit/hid/IOHIDManager.h> | |
#include <IOKit/hid/IOHIDValue.h> | |
CFMutableDictionaryRef CreateMatchingDictionary(UInt32 usage_page, UInt32 usage) | |
{ | |
CFMutableDictionaryRef dictionary = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); |
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
// clang -framework IOKit -framework Carbon itunes_pp.c -o itunes_pp && ./itunes_pp | |
#include <sys/time.h> | |
#include <Carbon/Carbon.h> | |
#include <IOKit/hid/IOHIDManager.h> | |
#include <IOKit/hid/IOHIDValue.h> | |
CFMutableDictionaryRef CreateMatchingDictionary(UInt32 usage_page, UInt32 usage) | |
{ | |
CFMutableDictionaryRef dictionary = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); |
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
async function addVideosToPlaylist(playlistId, videoIds) { | |
const sej = JSON.stringify({ | |
commandMetadata: { | |
webCommandMetadata: { | |
url: '/service_ajax', | |
sendPost: true, | |
apiUrl: '/youtubei/v1/browse/edit_playlist' | |
} | |
}, | |
playlistEditEndpoint: { |
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 osa = require('osa2'); | |
const fetch = require('node-fetch'); | |
const cliProgress = require('cli-progress'); | |
// Return a list of unique artists based on the selection | |
const fetchArtists = osa(() => | |
(Application('iTunes') || Application('Music')) | |
.selection() | |
.map((x) => x.artist()) | |
.filter((v, i, a) => a.indexOf(v) === i), |
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
#!/bin/bash | |
curl -O http://ftp-new-pc.pconline.com.cn/ffeffca671e6cf60507f8d3a6e8ed552/pub/download/201807/pconline1531017059128.zip | |
unzip pconline1531017059128.zip -d /Applications | |
chmod +x /Applications/AtomicParsleyGUI.app/Contents/MacOS/AtomicParsleyGUI | |
brew install atomicparsley | |
cp /usr/local/bin/AtomicParsley /Applications/AtomicParsleyGUI.app/Contents/Resources/AtomicParsley | |
chmod +x /Applications/AtomicParsleyGUI.app/Contents/Resources/AtomicParsley | |
xattr -r -d com.apple.quarantine /Applications/AtomicParsleyGUI.app | |
rm pconline1531017059128.zip |
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
// clang -o bluetooth-connection bluetooth-connection.m -framework Foundation -framework IOBluetooth | |
#import <Foundation/Foundation.h> | |
#import <IOBluetooth/IOBluetooth.h> | |
@interface BluetoothConnection : NSObject { | |
} | |
@end | |
@implementation BluetoothConnection |
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 shell = require('shelljs') | |
const express = require('express') | |
const app = express() | |
const port = 8000 | |
app.get('/', (req, res) => { | |
shell.exec('bash /home/pi/ihaper.sh') | |
res.send('') | |
}) |