Skip to content

Instantly share code, notes, and snippets.

@BlackMac
BlackMac / gist:87739
Created March 30, 2009 11:06
Ganz einfacher Ajax Request 2.0
new Ajax('url',{
'sgjson':true, // soll res bei onComplete json sein?
'windowspinner':true, // großen spinner auf dem Fenster anzeigen?
'data':{ // Diese Daten werden der Action als post übergeben
'x':'y',
'z':'a'
},
'onComplete':function(res) {
// res ist bereits als json geparsed!
}
<div id="main_content_head">
<div id="main_content_head_left_corner"></div>
<div id="main_content_head_right_corner"></div>
<h2><?php echo $this->translate('PAGETITLE_NOSMS') ?></h2>
</div>
@BlackMac
BlackMac / timetrack_logger.php
Created March 30, 2009 11:18
Logs your time in timetrack
<?php
if (!isset($_GET['h'])) {
echo "No Hash given";
exit;
}
$logtime=date("Y-m-d\TH:i:s");
$action="#";
if ($_GET['d']=="in") $action="+";
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
<meta name="generator" content="TextMate http://macromates.com/">
<meta name="author" content="">
<style type="text/css">
new OverText($$('#feld_id'));
// add this to your header:
NSString * UIFormattedPhoneNumberFromStringWithCountry(NSString *,NSString *);
NSString * UIFormattedPhoneNumberFromString(NSString *);
// use this where you need it:
NSString *myNumber=UIFormattedPhoneNumberFromStringWithCountry(@"+18004664411",@"de");
NSString *yourNumber=UIFormattedPhoneNumberFromString(@"+18004664411");
#!/bin/sh
/System/Library/PrivateFrameworks/GoogleContactSync.framework/Versions/A/Resources/gconsync --sync gconclid --register 1 --username *@*.com --password "*******" --syncmode fast --report 1
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIView *startupView=[[UIView alloc] initWithFrame:CGRectMake(0, 20, 320, 460)];
UIImageView *waitImage=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default.png"]];
UIActivityIndicatorView *activity=[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
[startupView addSubview:waitImage];
[startupView addSubview:activity];
[activity setFrame:CGRectMake(141, 200, 37, 37)];
[activity startAnimating];
[window addSubview:startupView];
NSOperationQueue *operationQueue=[[NSOperationQueue alloc] init];
@BlackMac
BlackMac / denic_new_domains.php
Created October 23, 2009 08:07
check for your provider in the double-character .de domains...
<?php
for ($a=0;$a<26;$a++) {
for ($b=0;$b<27;$b++) {
$fc=chr($a+97);
if ($b==0) {
$sc="";
} else {
$sc=chr($b+96);
}
UIDevice *myIphone=[UIDevice currentDevice];
myIphone.batteryMonitoringEnabled=YES;
float level=myIphone.batteryLevel;
UIDeviceBatteryState state = myIphone.batteryState;
myIphone.batteryMonitoringEnabled=NO;
NSString *statusText=@"";