Skip to content

Instantly share code, notes, and snippets.

#include <SystemConfiguration/SystemConfiguration.h>
- (NSDictionary *)getProxyInfo {
NSMutableDictionary *returnData = [[[NSMutableDictionary alloc] init] autorelease];
NSDictionary *proxies = (NSDictionary *)SCDynamicStoreCopyProxies(NULL);
BOOL HTTPEnabled = [[proxies objectForKey:(NSString *)kSCPropNetProxiesHTTPEnable] boolValue];
NSString *HTTPHost = @"";
NSNumber *HTTPPort = [NSNumber numberWithInt:80];
BOOL HTTPSEnabled = [[proxies objectForKey:(NSString *)kSCPropNetProxiesHTTPSEnable] boolValue];
NSString *HTTPSHost = @"";
NSNumber *HTTPPort = [NSNumber numberWithInt:443];
@atr000
atr000 / shellfm-growl.py
Created July 28, 2010 02:40
shell-fm python growl notifier
#!/usr/bin/env python
"""
Just put this line in your ~/.shell-fm/shell-fm.rc
np-cmd = /path/to/shellfm-notify "%a" "%t" "%l"
"""
import os
import sys
import Image
@atr000
atr000 / sysprefs.m
Created July 21, 2010 15:15
sysprefs.m
// (c) 2002 Julien Jalon <[email protected]>
// See license info at the end of this file.
#import <Foundation/Foundation.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SystemConfiguration.h>
#define PRINT(X) printf("%s\n", [[NSString stringWithFormat:@"%@", (X)] ISOLatin1EncodedCString])
@atr000
atr000 / levenshtein.cpp
Created July 16, 2010 13:23
levenshtein distance in cpp
//
// levenshtein.cpp
//
// Created by Julien-Pierre Avérous on 22/08/06.
// Copyright 2006 SourceMac.com. All rights reserved.
//
//
#include <iostream>
#include<string.h>
#include <iostream>
#include <gloox/client.h>
#include <gloox/connectionlistener.h>
#include <gloox/messagesession.h>
#include <gloox/messagehandler.h>
#include <gloox/message.h>
class Bot : public gloox::ConnectionListener, gloox::MessageHandler
{
public:
(*
Normalize Playlist
Accepts an itunes playlist as text input,
and normalizes all mp3 files on the playlist
with mp3gain -r (mp3gain itself decides how
best to normalize).
Prerequisities:
# irssi plug for last.fm
# http://soy.se/code/lastfm.pl
# vim: set noexpandtab:
use vars qw($VERSION %IRSSI);
$VERSION = "5.4";
%IRSSI = (
authors => "Simon 'simmel' Lundström",
contact => 'simmel@(freenode|quakenet|efnet) http://last.fm/user/darksoy',
name => "lastfm",
date => "20100526",
/*
gcc -framework "Foundation" -framework "IOKit" -o HWInfo HWInfo.m
*/
#import <Foundation/Foundation.h>
#import <IOKit/IOKitLib.h>
#include <sys/sysctl.h>
#include <sys/resource.h>
#include <sys/vm.h>
#include <stdio.h>
#include <string.h>
#include <IOKit/hidsystem/IOHIDLib.h>
#include <IOKit/hidsystem/IOHIDParameter.h>
#include <IOKit/hidsystem/event_status_driver.h>
int main(int argc, char **argv)
{
const int32_t accel = -0x10000;
io_connect_t handle = NXOpenEventStatus();
@atr000
atr000 / x264encoder.txt
Created May 28, 2010 16:10
x264encoder options in quicktime
Basic Tips for x264Encoder
Last update: May. 22nd 2010
Starter Method for Beginners
* If Data rate can be varied, choose Single pass + CRF.
If it is restricted, choose Multipass + Data rate.
* If for Mac/PC only, choose Single pass + CRF.
If for iPod/etc. also, choose Multipass + Data rate.
* If for Mac/PC only, check frame reordering.
If for iPod/etc. also, uncheck frame reordering.