Skip to content

Instantly share code, notes, and snippets.

View core-code's full-sized avatar

CoreCode core-code

View GitHub Profile
@core-code
core-code / sort_like_bbedit_does_it.py
Last active May 26, 2023 16:47
sort a file exactly like BBEdit
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import sys
from functools import cmp_to_key
def cmp_items_inner(a, b):
if len(a) > 0 and len(b) == 0:
return 1
elif len(a) == 0 and len(b) > 0:
@core-code
core-code / SUDiskImageUnarchiver.m
Created November 16, 2021 08:50
SUDiskImageUnarchiver.m without possible hang
//
// SUDiskImageUnarchiver.m
// Sparkle
//
// Created by Andy Matuschak on 6/16/08.
// Copyright 2008 Andy Matuschak. All rights reserved.
//
#import "SUDiskImageUnarchiver.h"
#import "SUUnarchiverNotifier.h"
#!/usr/bin/python
import cgi
import urllib2
import json
import base64
form = cgi.FieldStorage()
url = form.getvalue("url", "")
splitters = form.getvalue("splitters", "")
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
static void enable_tracks(AVFormatContext *s)
{
MOVMuxContext *mov = s->priv_data;
int i;
int enabled[AVMEDIA_TYPE_NB];
int first[AVMEDIA_TYPE_NB];
for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
enabled[i] = 0;
first[i] = -1;
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool
{
BOOL broken = FALSE;
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtURL:[NSURL fileURLWithPath:@"~".stringByExpandingTildeInPath]
includingPropertiesForKeys:@[NSURLIsRegularFileKey, NSURLIsPackageKey]
options:(NSDirectoryEnumerationOptions)0 errorHandler:nil];
using System;
using Irony.Parsing;
using System.Collections.Generic;
using Newtonsoft.Json;
using System.Linq;
namespace XLParser
{
public class JSONExport
{
public static string ParseToJSON(string input)
{
var export = new JSONExport ();
return export.ParseToJSON (input);
}
Process: The Unarchiver [9835]
Path: /Applications/The Unarchiver.app/Contents/MacOS/The Unarchiver
Identifier: cx.c3.theunarchiver
Version: 3.9.1 (3.9.1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: The Unarchiver [9835]
User ID: 501
/***************************************************************************
// PrintSMARTData - Prints S.M.A.R.T data // mostly from apple saple code
//***************************************************************************
static IOReturn PrintSMARTData(io_service_t service, char *smart)
{
IOCFPlugInInterface **cfPlugInInterface = NULL;
IOATASMARTInterface **smartInterface = NULL;
HRESULT herr = S_OK;
IOReturn err = kIOReturnSuccess;