This file contains 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
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
This file contains 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
# https://gist.github.com/4948295 | |
# GistID: 4948295 | |
# | |
# prereq: | |
# apt-get install build-essential clang gobjc libicu-dev libxml2-dev libgnutls-dev libssl-dev | |
# | |
# Based on: http://www.dev-smart.com/archives/401 | |
# Install: | |
# clang (Low-Level Virtual Machine (LLVM), C language family frontend) |
This file contains 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
#pragma once | |
// Copyright (c) 2008-2010, Vincent Gable. | |
// [email protected] | |
//based off of http://www.dribin.org/dave/blog/archives/2008/09/22/convert_to_nsstring/ | |
NSString * VTPG_DDToStringFromTypeAndValue(const char * typeCode, void * value); | |
// WARNING: if NO_LOG_MACROS is #define-ed, than THE ARGUMENT WILL NOT BE EVALUATED | |
#ifndef NO_LOG_MACROS |
This file contains 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 sys | |
""" | |
Resolve the DNS/IP address of a given domain | |
data returned is in the format: | |
(name, aliaslist, addresslist) | |
@filename resolveDNS.py | |
@version 1.01 (python ver 2.7.3) | |
@author LoanWolffe | |
""" |
This file contains 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
-- Uses cleaner syntax than common solutions for toggling the state of the Notification Center in Mac OS X Mountain Lion (10.8) | |
set notificationStatus to do shell script "defaults -currentHost read com.apple.notificationcenterui doNotDisturb" | |
if notificationStatus is equal to "1" then | |
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -boolean false" | |
do shell script "defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate" | |
do shell script "launchctl stop com.apple.notificationcenterui.agent" | |
else | |
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -boolean true" |
This file contains 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
#!/bin/bash | |
SAVEIFS=$IFS | |
IFS=$(echo -en "\n\b") | |
for f in * | |
do | |
echo "$f" | |
done | |
IFS=$SAVEIFS |
This file contains 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
ptr := FSPointer objectPointer | |
scanner := NSScanner scannerWithString:'0x234243242' | |
scanner scanHexLongLong:ptr | |
object := ptr at:0 |
This file contains 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
#define _GNU_SOURCE | |
#include <unistd.h> | |
#include <sys/syscall.h> | |
#include <sys/types.h> | |
#include <sys/utsname.h> | |
#include <stdio.h> | |
#include <string.h> | |
int uname(struct utsname *buf) |
This file contains 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/python | |
# | |
# Copyright (C) 2007 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains 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
# https://www.virtualbox.org/manual/ch03.html | |
VBoxManage setextradata "Mountain Lion Cage" VBoxInternal2/EfiGopMode 3 | |
VBoxManage modifyvm "Mountain Lion Cage" --firmware efi | |
VBoxManage setextradata "Mountain Lion Cage" VBoxInternal2/SmcDeviceKey "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" | |
# https://www.virtualbox.org/manual/ch14.html | |
VBoxManage setextradata "Mountain Lion Cage" "VBoxInternal2/EfiBootArgs" "-v" | |
OlderNewer