Skip to content

Instantly share code, notes, and snippets.

@eeeyes
eeeyes / android_configure.sh
Created November 4, 2018 04:22 — forked from nddrylliog/android_configure.sh
Cross-compile autotools library for Android / arm-linux-androideabi I stick that in ~/bin/, chmod +x, and then run it in place of "./configure" in my project. Then a make and make install later, the prefix contains libraries built for android. Neato eh?
#!/bin/sh
# I put all my dev stuff in here
export DEV_PREFIX=$HOME/Dev/
# Don't forget to adjust this to your NDK path
export ANDROID_NDK=${DEV_PREFIX}/android-ndk-r8d/
export CROSS_COMPILE=arm-linux-androideabi
@eeeyes
eeeyes / cpu-usage.cpp
Created April 18, 2018 02:24 — forked from hisui/cpu-usage.cpp
[iOS] Getting current CPU usage.
#include <mach/mach.h>
// http://stackoverflow.com/questions/8223348/ios-get-cpu-usage-from-application
double getCurrentCPUUsage()
{
thread_array_t threads;
mach_msg_type_number_t threadCount;
if (task_threads(mach_task_self(), &threads, &threadCount) != KERN_SUCCESS) {
return -1;
}
@eeeyes
eeeyes / mnist.py
Created January 29, 2018 07:02 — forked from akesling/mnist.py
import os
import struct
import numpy as np
"""
Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py
which is GPL licensed.
"""
def read(dataset = "training", path = "."):
@eeeyes
eeeyes / LICENSE.md
Created November 20, 2016 08:47 — forked from s4y/LICENSE.md
For Mac OS X: Get a list of running processes, and tell if a particular process is running, by name

Copyright (c) 2010 DeepTech, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O

ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@eeeyes
eeeyes / thread_return.py
Created September 22, 2016 05:08
lldb python script that provides a function to… Prints the return value of the last function you stepped out from. This is very useful if the return was a complex expression. This lldb command prevents you from needing to create a temporary variable just to inspect the return value''' (If anyone knows a way of doing this without using needing to…
#/usr/bin/env python
import lldb
# Put _this_ file into ~/Library/lldb/thread_return.py
# Put the following line into ~/.lldbinit
# command script import ~/Library/lldb/thread_return.py
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f thread_return.thread_return thread_return')
@eeeyes
eeeyes / libimobiledevicecompileosx.sh
Created August 10, 2016 04:21 — forked from carsonmcdonald/libimobiledevicecompileosx.sh
Compile libimobiledevice and every it needs in one script.
#!/bin/sh
mkdir installroot
INSTALLROOT=`pwd`/installroot
echo "Downloading and installing pkg-config"
curl -OL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz
tar xvzf pkg-config-0.28.tar.gz
cd pkg-config-0.28
@eeeyes
eeeyes / XCDUUID.m
Last active August 29, 2015 14:12 — forked from OliverLetterer/XCDUUID.m
@implementation XCDUUID
+ (void) load
{
// query runtime if NSUUID class already exists, if so => done
if (objc_getClass("NSUUID"))
{
return;
}