Skip to content

Instantly share code, notes, and snippets.

View fish2000's full-sized avatar
👉
My Python work is on the Mars helicopter, and ubiquitous on earth, and more!!!!

Alexander Böhn fish2000

👉
My Python work is on the Mars helicopter, and ubiquitous on earth, and more!!!!
  • Objects in Space and Time, LLC
  • Baltimore, MD
  • 02:31 (UTC -04:00)
  • X @fish2000
View GitHub Profile
import sys, os, os.path, tempfile, plistlib, shutil, marshal, subprocess, pickle, textwrap
class TempApp(object):
_skeleton_app = textwrap.dedent("""
import sys, marshal, types, pickle
main_func_marshal = %s
args_pickle = %s
code = marshal.loads(main_func_marshal)
main_func = types.FunctionType(code, globals(), "main_func")
args = dict(pickle.loads(args_pickle))
formula = ARGV.formulae.first
pkg_config_name = ARGV.value("pkg-config-name") || formula.name
dep_formulae_list = []
env_methods_list = []
cflags_I = `pkg-config --cflags-only-I #{pkg_config_name}`.chomp.split.
map { |f| f.sub(/^-I/, "") }.map do |path|
if path =~ %r{^#{Regexp.escape(HOMEBREW_CELLAR.to_s)}/([^/]+)/[^/]+/(include|lib)(/.*)?} ||
path =~ %r{^#{Regexp.escape(HOMEBREW_PREFIX.to_s)}/opt/([^/]+)/(include|lib)(/.*)?}
if $1 == formula.name
%[-I\#{#{$2}}#{$3}]
@nevyn
nevyn / GFNamespace.h
Created January 8, 2015 04:07
This is how I use open source libraries like SPAsync, FormatterKit, SWTableViewCell and others within the Lookback SDK, without getting linking conflicts within apps that use the same libraries.
// http://rentzsch.tumblr.com/post/40806448108/ns-poor-mans-namespacing-for-objective-c
// This namespacing method is used to namespace libraries used by Lookback, so
// that apps incorporating the SDK can have the same class in it without clashing.
// (ugh, give me swift nooow).
#ifndef GFNAMESPACE
// Default to using the 'GF' prefix
#define GFNAMESPACE GF
#endif
@ashildebrandt
ashildebrandt / ash_ffffind.py
Last active April 3, 2022 22:38
Ffffind (downloads every image from a given FFFFOUND! account)
"""
ash_ffffind.py
v1.1 (September 14, 2015)
by [email protected]
Automatically downloads all images from ffffound saved by a specific user.
Will first try to download the image from the original source (to get the highest quality possible).
If that fails, it'll download the cached version from ffffound.
@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active December 29, 2024 19:56
OpenCV Video Writer on Mac OS X
@Shilo
Shilo / color.m
Last active October 8, 2015 07:36 — forked from kylefox/color.m
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
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
@Nyx0uf
Nyx0uf / gist:217d97f81f4889f4445a
Last active November 15, 2020 22:31
UIImage scale using vImage
-(UIImage*)mmg_imageScaledToFitSize:(CGSize)fitSize
{
// Create a vImage_Buffer from the CGImage
CGImageRef sourceRef = self.CGImage;
vImage_Buffer srcBuffer;
vImage_CGImageFormat format = {
.bitsPerComponent = 8,
.bitsPerPixel = 32,
.colorSpace = NULL,
.bitmapInfo = (CGBitmapInfo)kCGImageAlphaFirst,
@kaloyan
kaloyan / std.cpp
Last active July 2, 2018 23:52 — forked from mahuna13/std.cpp
#include "std_try.h"
#include <math.h>
using namespace Halide;
#define PI 3.14159
/*
Interpolations
*/
@gamenerds
gamenerds / NSPointerArray+AbstractionHelpers.h
Last active September 17, 2019 12:49
A category to abstract the details of NSPointerArray
#import <Foundation/Foundation.h>
// This helps deal with NSPointerArray that stores pointers to objects that inherit from NSObject.
// Not sure if this will work for other pointer types!!
@interface NSPointerArray (Helpers)
/**
* Adds pointer to the given object to the array.
*
* @param object Object whose pointer needs to be added to the array.
@cstorey
cstorey / IMG.sh.txt
Last active August 29, 2015 14:03
Render an image in a 256 colour capable terminal.
Adapted for 256 color terminals from the 24-bit colour version at https://git.gnome.org/browse/vte/tree/perf/img.sh?h=vte-0-36 .
Original script (and this adaptation) licensed under GPLv2.
Octocat image used under presumed license from https://octodex.github.com/faq.html