Skip to content

Instantly share code, notes, and snippets.

@qwerty12
qwerty12 / IntelPWMManipulation.cpp
Created August 7, 2013 21:16
Based on eDio and medvegiypreved's work here: https://wiki.archlinux.org/index.php/Backlight#Backlight_PWM_modulation_frequency_.28Intel_i915_only.29 and EmlyDinesh's code to write to the memory address DON'T USE THIS AS-IS!
#include <IOKit/IOService.h>
class IntelPWMManipulation : public IOService
{
OSDeclareDefaultStructors(IntelPWMManipulation);
public:
bool start(IOService *provider);
};
@qwerty12
qwerty12 / .dircolors
Created July 15, 2013 11:40
dircolors configuration used
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copying and distribution of this file, with or without modification,
# are permitted provided the copyright notice and this notice are preserved.
# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.
# Below, there should be one TERM entry for each termtype that is colorizable
TERM Eterm
TERM ansi
@qwerty12
qwerty12 / visor.diff
Created July 15, 2013 02:22
Some tweaks to Toy Chest for binaryage's TotalTerminal
--- toychest.terminal 2013-05-18 05:42:25.000000000 +0100
+++ Visor.terminal 2013-05-18 05:45:07.000000000 +0100
@@ -162,12 +162,12 @@
<data>
YnBsaXN0MDDUAQIDBAUGHyBYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKUHCBEVHFUkbnVsbNQJCgsMDQ4PEFVOU1JHQlxOU0NvbG9yU3BhY2VfEBJOU0N1
- c3RvbUNvbG9yU3BhY2VWJGNsYXNzTxAnMC4xNTY4NjI3NDUxIDAuMjM1Mjk0MTE3NiAw
- LjMwMTk2MDc4NDMAEAGAAoAE0hIMExRUTlNJRBABgAPSFhcYGVokY2xhc3NuYW1lWCRj
- bGFzc2VzXE5TQ29sb3JTcGFjZaIaG1xOU0NvbG9yU3BhY2VYTlNPYmplY3TSFhcdHldO
- U0NvbG9yoh0bXxAPTlNLZXllZEFyY2hpdmVy0SEiVHJvb3SAAQAIABEAGgAjAC0AMgA3
@qwerty12
qwerty12 / toychest.diff
Created July 15, 2013 02:21
Modifications to Jackson Gariety's Toy Chest theme (thank you ;))
# Get the theme from here: http://toychesttheme.com/
--- toychest.terminal 2013-05-18 05:42:44.000000000 +0100
+++ toychest.terminal 2013-05-18 05:42:25.000000000 +0100
@@ -169,18 +169,18 @@
AD0AQwBMAFIAXwB0AHsApQCnAKkAqwCwALUAtwC5AL4AyQDSAN8A4gDvAPgA/QEFAQgB
GgEdASIAAAAAAAACAQAAAAAAAAAjAAAAAAAAAAAAAAAAAAABJA==
</data>
+ <key>BlinkText</key>
+ <false/>
<key>CursorBlink</key>
@qwerty12
qwerty12 / _brew.zsh
Created July 15, 2013 02:04
brew_zsh_completion.zsh from Homebrew with the "versions" completion added back in again
#compdef brew
# Brew ZSH completion function
# Drop this somewhere in your $fpath (like /usr/share/zsh/site-functions)
# and rename it _brew
#
# altered from _fink
_brew_all_formulae() {
formulae=(`brew search`)
@qwerty12
qwerty12 / superenv.rb.diff
Created April 29, 2013 13:56
Quick-'n'-dirty ccache hack for Homebrew
def determine_path
paths = [superbin]
+ if not ARGV.include? "--no-ccache"; paths.unshift "#{HOMEBREW_PREFIX}/Cellar/ccache/3.1.9/libexec:"; ENV.append 'CCACHE_DISABLE', "1"; end
@qwerty12
qwerty12 / pidof.c
Created March 14, 2013 12:51
Butchered version of Night Productions' pidof utility for OS X
#import <sys/sysctl.h>
#import <stdlib.h>
#import <string.h>
int pidof(const char *argv)
{
struct kinfo_proc *kp;
int mib[4],nentries,i;
size_t bufSize=0;
@qwerty12
qwerty12 / run-java.sh
Created February 20, 2013 01:39
Stupid wrapper for Sublime Text's JavaC Build System
#!/bin/sh
javac "$1"
if [ $? == 0 ]; then
#Thanks to Ken Pizzini: http://www.linuxmisc.com/12-unix-shell/4cd9a157aa806d45.htm
retval=`exec 3>&1; /opt/X11/bin/xterm -e sh -c '/usr/bin/java "'$2'" 3>&-; echo $? 1>&3; echo "Press ENTER to quit..."; read'`
rm "$2"*.class
exit $retval
fi
@qwerty12
qwerty12 / ldid.rb
Created February 6, 2013 23:15
Install a newer version of ldid from homebrew using Matthias Ringwald's work on the Fink version
require 'formula'
class Minimal < Formula
url 'http://ringwald.ch/fink/minimal-e327d27b214753a35b03a89886c82311c96353fa.tar.gz'
md5 '63926a804a44d5c36e8c0036ed653dbb'
end
class Ldid < Formula
homepage 'http://www.saurik.com/id/8'
url 'http://ringwald.ch/fink/ldid-4f4aa9c37a0c26908cafbc5ef58c94814d153415.tar.gz'
@qwerty12
qwerty12 / ATKMediaInterceptor.c
Created November 18, 2012 14:44
Butchered version of zaak404's ATKMediaInterceptor for global media keys support
#include <windows.h>
#ifndef VK_MEDIA_NEXT_TRACK
#define VK_MEDIA_NEXT_TRACK 0xB0
#endif
#ifndef VK_MEDIA_PREV_TRACK
#define VK_MEDIA_PREV_TRACK 0xB1
#endif
#ifndef VK_MEDIA_STOP
#define VK_MEDIA_STOP 0xB2