Skip to content

Instantly share code, notes, and snippets.

@javadoug
javadoug / gist:ca53c0c9772f71c8d3690f57d87cf58a
Created March 14, 2018 17:34
AXUIElementAXValue in swift 4 MacOS SDK 12
class AXUIElementAXValue {
private class func copyAXValue<T>(_ value: AXValue, type: AXValueType, _ handler: (_ memory: T?) -> T) -> T {
let val = UnsafeMutablePointer<T?>.allocate(capacity: 1)
AXValueGetValue(value, type, val)
let ret = handler(val.pointee)
val.deallocate(capacity: 1)
return ret
}
@javadoug
javadoug / pi-tips.md
Created November 12, 2016 18:57 — forked from rdmarsh/pi-tips.md
Clean up the Raspbian default build for the Raspberry Pi

Remove unused packages on Raspberry Pi

(this is worth looking at http://www.stefan-seelmann.de/wiki/rasperrypi-homeserver, which is basically this:

apt-get purge --auto-remove scratch debian-reference-en dillo idle3 python3-tk idle python-pygame python-tk lightdm gnome-themes-standard gnome-icon-theme raspberrypi-artwork gvfs-backends gvfs-fuse desktop-base lxpolkit netsurf-gtk zenity xdg-utils mupdf gtk2-engines alsa-utils  lxde lxtask menu-xdg gksu midori xserver-xorg xinit xserver-xorg-video-fbdev libraspberrypi-dev libraspberrypi-doc dbus-x11 libx11-6 libx11-data libx11-xcb1 x11-common x11-utils lxde-icon-theme gconf-service gconf2-common

)

Warning: this will probably break something. If you need sound, don't remove the "alsa" packages

sudo apt-get --yes purge xserver-common x11-xfs-utils x11-xserver-utils xinit libsmbclient blt gvfs gvfs-backends gvfs-daemons gvfs-fuse idle idle-python2.7 idle-python3.2 idle3 libaudio2 libice6 liblightdm-gobject-1-0 libobrender27 libpulse0 libqt4-svg libqt

@javadoug
javadoug / svg2dxf.sh
Last active March 30, 2016 12:46 — forked from winder/svgToDxf.sh
# Convert SVG to EPS
# on mac run brew install pstoedit then
# add these two functions to your .bashrc file
# source .bashrc if terminal is already open
# Usage:
# > svg2dxf art.svg # outputs art.dxf
#
function svg2eps() {
if test $# -lt 1 ; then
echo "You need to pass in a filename." ; return
@javadoug
javadoug / transparent-background-img.css
Created August 6, 2015 16:56
create transparent background images in css trick
/* from https://css-tricks.com/snippets/css/transparent-background-images/ */
div {
width: 200px;
height: 200px;
display: block;
position: relative;
}
div::after {
content: "";
@javadoug
javadoug / csslint.sublime-build
Created February 9, 2012 22:26 — forked from hellosze/csslint.sublime-build
csslint - build config for Sublime Text 2
{
"cmd": ["csslint", "$file_name"],
"path": "/usr/local/bin",
"selector": "source.css",
"file_regex": "^(.*\\.css)$",
"line_regex": "line ([0-9]+)"
}