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 Darwin | |
// Call proc_listallpids once with nil/0 args to get the current number of pids | |
let initialNumPids = proc_listallpids(nil, 0) | |
// Allocate a buffer of these number of pids. | |
// Make sure to deallocate it as this class does not manage memory for us. | |
let buffer = UnsafeMutablePointer<pid_t>.allocate(capacity: Int(initialNumPids)) | |
defer { | |
buffer.deallocate() |
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
#!/usr/bin/ruby | |
current_filename = nil | |
current_file = nil | |
# http://anthonylewis.com/2011/02/09/to-hex-and-back-with-ruby/ | |
def hex_to_bin(s) | |
s.scan(/../).map { |x| x.hex }.pack('c*') | |
end |
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
#include <io.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <windows.h> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <setupapi.h> | |
#include <sys/stat.h> |
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
// | |
// Created by Kevin Wojniak on 2014/9/23. | |
// Copyright (c) 2014 Kevin Wojniak. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) { | |
const char *inputFile = argv[1]; | |
const char *outputFile = argv[2]; |
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
// Public domain. | |
#include <iostream> | |
#include <string> | |
namespace { | |
template <typename T> | |
class fmt_base { | |
public: |
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
#!/usr/bin/env ruby | |
# Copies missing Info.plist files for a .app's Qt frameworks installed | |
# from macdeployqt. Without the plists, 'codesign' fails on 10.9 with | |
# "bundle format unrecognized, invalid, or unsuitable". | |
# | |
# Example usage: | |
# ruby macdeployqt_fix_frameworks.rb /Users/me/Qt5.2.0/5.2.0/clang_64/ MyProgram.app | |
# | |
# Links: |